flat assembler
Message board for the users of flat assembler.
Index
> Windows > Fasm 1.73 How build syntax tree ? |
Author |
|
Roman 11 Aug 2020, 17:42
I want parse my text line and build syntax tree.
How do this in Fasm code ? Txt db 'print: 4*var+1',13,10,0 Somthing like this. |
|||
11 Aug 2020, 17:42 |
|
DimonSoft 11 Aug 2020, 19:40
Have you read Dragon book?
|
|||
11 Aug 2020, 19:40 |
|
Roman 11 Aug 2020, 21:16
Thanks.
Now reading. |
|||
11 Aug 2020, 21:16 |
|
bitRAKE 11 Aug 2020, 22:51
Some people think the first step is tokenization. This is where the source is broken into larger abstractions. To do this you will need to construct a model of your language. For example, maybe you limit input to ASCII, or just numbers and math symbols. Maybe you have predefined symbols or more complex constructions. Find a model that can be decoded - it's possible for a language model to have built-in problems.
There are languages to describe language models: BNF, EBNF, etc ... If you want to build a very small langauge for learning - I would say to just jump in and make mistakes. Like a simple calculator (with variables), etc ... There are tools to build parsers from a language model: YACC, etc ... It can get really complex fast. The dragon book is getting quite dated - as are the tools I mention above. So much research has happened since then, and modern languages have also evolved. Yet, it's a great overview. FYI: there is a section of the board specifically for language design. _________________ ¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup |
|||
11 Aug 2020, 22:51 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.