Пример #1
0
#!/usr/bin/env python

from lexico import Lexico
from pila import Pila
from interRI import InterRI
import sys

if __name__ == '__main__':
    archivo = sys.argv[1]
    f = file(archivo,"r").readlines()
    s = "".join(f)
    l = Lexico(s=s)
    l.analizar()
    t = l.getTokens()
    t.reverse()
    inter = InterRI(t)
    inter.ejecutar()
    p = inter.getMainStack()
Пример #2
0
from lexico import Lexico
from pila import Pila
from interRI import InterRI
import sys

s = sys.argv[1]
l = Lexico(s=s)
l.analizar()
t = l.getTokens()
print t
t.reverse()

inter = InterRI(t)
inter.ejecutar()
p = inter.getMainStack()
print p
print inter.getTabla()