lexer
flex auto generated file can't be used?
I\'m using flex lexer as a lexer 开发者_如何学JAVAfor my compiler project and I have this function to change the lexer input stream as follows:[详细]
2023-03-08 23:16 分类:问答is there a way to perform a look-ahead with fslex/Lexing.LexBuffer
I\'m using fslex and in one of my tokenizer rules I need to look for the next char so I can decide whether to continue consuming tokens or to stop, unwind and let the previous rule consume it.[详细]
2023-03-06 20:10 分类:问答Understanding the inner workings of a programming language
Where 开发者_JS百科would be a good place to start learning the inner workings of a programming language like C?[详细]
2023-03-06 13:28 分类:问答Is the word "lexer" a synonym for the word "parser"?
The title is the question: Are the words \"lexer\" and \"parser\" synonyms, or are they di开发者_如何学JAVAfferent? It seems that Wikipedia uses the words interchangeably, but English is not my native[详细]
2023-03-03 19:57 分类:问答Can ANTLR differentiate between lexer rules based on the following character?
For parsing a test file I\'d like to allow identifier\'s to begin with a number. my rule is: ID:(\'a\'..\'z\' | \'A\'..\'Z\' | \'0\'..\'9\' | \'_\') (\'a\'..\'z\' | \'A\'..\'Z\' | \'0\'..\'9\' | \'_[详细]
2023-02-22 18:49 分类:问答When parsing Javascript, what determines the meaning of a slash?
Javascript has a tricky grammar to parse.Forward-slashes can mean a number of different things: division operator, regular expression literal, comment introducer, or line-comment introducer.The last t[详细]
2023-02-21 04:58 分类:问答Programming a simple compiler
I am writing a compiler for a simple language. I made a lexer/tokenizer that takes a file and prints the tokens in stdout.[详细]
2023-02-19 20:44 分类:问答Writing part of a compiler (written in c++) in Perl
i am trying to learn more about compilers and programming languages, unfortunately my university doesnt offer a course about compilers and so i have to do myself (thank you internet).[详细]
2023-02-18 19:53 分类:问答Where should I draw the line between lexer and parser?
I\'m writing a lexer for the IMAP protocol for educational purposes and I\'m stumped as to where I should draw the line between lexer and parser. Take this example of an IMAP server response:[详细]
2023-02-17 16:20 分类:问答Solving ambiguities in grammars
I am writing a parser for delphi\'s dfm\'s files. The lexer looks like this: EXP ([Ee][-+]?[0-9]+) %% (\"#\"([0-9]{1,5}|\"$\"[0-9a-fA-F]{1,6})|\"\'\"([^\']|\'\')*\"\'\")+ {[详细]
2023-02-13 00:51 分类:问答