Sha256: f8e2ce218135ded84ecf3000db375d9b8d996921bfa7a9e9d58b480245619929

Contents?: true

Size: 529 Bytes

Versions: 8

Compression:

Stored size: 529 Bytes

Contents

import sys

if ".." not in sys.path: sys.path.insert(0,"..")

from ply import lex, yacc

t_A = 'A'
t_B = 'B'
t_C = 'C'

tokens = ('A', 'B', 'C')

the_lexer = lex.lex()

def t_error(t):
    pass

def p_error(p):
    pass

def p_start(t):
    '''start : A nest C'''
    pass

def p_nest(t):
   '''nest : B'''
   print(t[-1])

the_parser = yacc.yacc(debug = False, write_tables = False)

the_parser.parse('ABC', the_lexer)
the_parser.parse('ABC', the_lexer, tracking=True)
the_parser.parse('ABC', the_lexer, tracking=True, debug=1)

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
webruby-0.2.7 modules/emscripten/third_party/ply/test/yacc_nested.py
webruby-0.2.5 modules/emscripten/third_party/ply/test/yacc_nested.py
webruby-0.2.4 modules/emscripten/third_party/ply/test/yacc_nested.py
webruby-0.2.2 modules/emscripten/third_party/ply/test/yacc_nested.py
webruby-0.2.1 modules/emscripten/third_party/ply/test/yacc_nested.py
webruby-0.1.2 modules/emscripten/third_party/ply/test/yacc_nested.py
webruby-0.1.1 modules/emscripten/third_party/ply/test/yacc_nested.py
webruby-0.1.0 modules/emscripten/third_party/ply/test/yacc_nested.py