Lexemes, Tokens, Pattern, Attributes for tokens and Regular definition
16 January, 2016
Lexemes, tokens and pattern are important.
FSA: Lexical analyzer are based on a simple computational model called the Finite State Automation. Their functionality are to accept the language with the help of machine .
In FSA, it takes the string and answer is yes if its right , and no otherwise.
This can be done by DFA and NFA. Both recognizes the regular sets.
we define regular expressions for tokens; Then we convert them into a DFA to
get a lexical analyzer for our tokens.
–Algorithm1: Regular Expression è NFA è DFA (two steps: first
to NFA, then to DFA)
–Algorithm2: Regular Expression
•A NFA accepts a string x, if and
only if there is a path from the starting state to one of accepting states such
that edge labels along this path spell out x.