Last active
December 15, 2015 02:49
-
-
Save filhodanuvem/5189574 to your computer and use it in GitHub Desktop.
How a simple parser to python can generate a AST ?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def foo(): | |
name = "cloud" | |
age = 22 | |
if age > 22 : | |
print name | |
age += 1 |
jeanpimentel
commented
Mar 18, 2013
no lexico, se leu \n, vai pro estado qn
leia o proximo, se \s ou \t, conte e armazene até sair de qn
ao sair de qn
se atual > anterior => T_IDENT_START
senao se atual = anterior => null
senao => T_IDENT_END
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment