Why use Lexical Analyzers?

I am building my own language with Flex, but I want to know some things:

  • Why should I use lexical analyzers?
  • Will they help me something?
  • Are they required?
+3
source share
3 answers

Lexical analysis helps to simplify parsing, since tokens can be considered as abstract entities, rather than specific sequences of characters.

You need more than flexibility to build your language: Lexical analysis is only the first step.

+5
source

, , / , . else if (strcmp (..)==0) ... . , sscanf strtok, - .

, flex, :

  • .
  • , flex. , C scanf. scanf , . .
  • Lex . / , .
+3

, BNF ( EBNF) () , , , , .

, , , , , .

, , (BNF) , , , , .

+1

Source: https://habr.com/ru/post/1724292/


All Articles