Skip to main content
12 events
when toggle format what by license comment
Aug 27, 2019 at 12:38 comment added Shahlin Ibrahim @BartvanIngenSchenau Thanks, will try
Aug 27, 2019 at 10:51 comment added Bart van Ingen Schenau @ShahlinIbrahim: Yes, that is exactly the job of a parser.
Aug 27, 2019 at 10:47 comment added Shahlin Ibrahim @BartvanIngenSchenau Is it possible to build an abstract syntax tree from tokens?
Aug 27, 2019 at 10:41 comment added Bart van Ingen Schenau @ShahlinIbrahim: You should research the topic of parsers. Your way of validation was most likely too simplistic, because the language you described should pose no problem at all for a parser.
Aug 27, 2019 at 7:35 comment added Shahlin Ibrahim @BartvanIngenSchenau I tried to check if the tokens are valid by looping through each one. But the possibilities are too many. There can be nested expressions, strings, functions, variables, etc. at any location. I guess maybe my way of validating was wrong
Aug 27, 2019 at 7:14 comment added Philip Kendall The canonical reference here is the dragon book.
Aug 27, 2019 at 7:10 review Close votes
Aug 30, 2019 at 16:48
Aug 27, 2019 at 7:00 comment added Bart van Ingen Schenau @ShahlinIbrahim, the next step is to create a parser that can tell from a set of tokens if they form a valid construct in your language and what that construct means.
Aug 27, 2019 at 6:51 comment added gnat Possible duplicate of How to do a clean refactoring of an If Else Code without leaving any free blocks?
Aug 27, 2019 at 6:50 comment added Shahlin Ibrahim @Kain0_0 Thank you for the recommendation, will give it a read. As mentioned above, I am using Doctrine Lexer for lexing, it's the next steps that I don't know of
Aug 27, 2019 at 6:14 comment added Kain0_0 There are many lexing/grammar packages out there. You simply need to search for them. I found reading Crafting Interpreters to be quite helpful in general.
Aug 27, 2019 at 5:57 history asked Shahlin Ibrahim CC BY-SA 4.0