Skip to content

Instantly share code, notes, and snippets.

@ikeikeikeike
Created March 22, 2012 17:40
Show Gist options
  • Save ikeikeikeike/2160659 to your computer and use it in GitHub Desktop.
Save ikeikeikeike/2160659 to your computer and use it in GitHub Desktop.
run lexer.py
$ py lexer.py
LexToken(NUMBER,Decimal('3'),2,5)
LexToken(PLUS,'+',2,7)
LexToken(NUMBER,Decimal('2'),2,9)
LexToken(MULT,'*',2,11)
LexToken(NUMBER,Decimal('4'),2,13)
LexToken(DIV,'/',2,15)
LexToken(NUMBER,Decimal('2'),2,17)
------------------------------------------
------------------------------------------
LexToken(STRING,'name',2,5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment