The creation of the lexical analyzer


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/code-flow.club/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
4 views
You want to create a lexical analyzer in the likeness of lex/flex.
That is, the input is free text and rules for the allocation of tokens using regular expressions, the output stream of tokens.
Don't know how to approach the solution of the problem, we need a sensible literature...
by | 4 views

3 Answers

0 like 0 dislike
I don't think there is literature on writing something like flex.
You need: to input the script text and rules, the output tokens.
So we need a translator with dynamic rules that are set regexpname. Parsim rules of text parsing, using the rules and rasparenny regexpal, parsim text, translate into tokens. I think many will agree with me that it is better dragon book you will not be able to find anything.
by
0 like 0 dislike
Look at yacc or the free counterpart GNU Bison. They allow you to construct lexical analyzers on the basis of your own grammar.
by
0 like 0 dislike
read the book of the dragon
by

Related questions

0 like 0 dislike
3 answers
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
asked Apr 12, 2019 by fruity4pie
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
110,608 questions
257,186 answers
0 comments
23,082 users