Help needed with tokens and lexemes

Programming languages (Html, PHP, Java, Perl, Basic, QBasic, Cobol, Fortran, Lisp, Visual Basic, Python, C, C++, Perl, Javascript, Java, C#, Ruby, Delphi, Object Pascal, Cold Fusion), Interpreters and Compilers, Software Development. Get help with assembly languages, declarative languages, machine languages, object-oriented languages, iterative languages, on My Computer Forum

Moderators: shynthriir, johnny, SidT

Help needed with tokens and lexemes

Postby GlobeXgr » Fri Jan 22, 2010 10:16 am

i have a problem understanding tokens an lexemes...and i really could use some help.....
I was given the following sentences and i have to define the tokens, lexemes, patterns and the regular expressions for the following 3 sentences:

Use triangle ABC
Use square ABCD
Use angle A

the names of triangle, square or angle is defined as the use of 3,5 or one of the first five letters of the latin alphabet (A,B,C,D,E)...
i know this might be easy for you guys but i am new to this...
thanks in advance

Also i have to create one dfa(deterministic finite automata) that describes the names of the above geometrical entities(e.g ABC, ABCD ,A).
I could use some help with theregular expression.....
and a quick question: Can a token have more than one lexeme?
GlobeXgr
 
Posts: 1
Joined: Fri Jan 22, 2010 9:55 am

Return to Program Languages and Compilers

Who is online

Registered users: No registered users

cron