示例#1
0
def get_parser_generator(file_name):
    scanner = MbnfScanner()
    tokens = scanner.scan(argv[2])
    parser = MbnfParser(tokens)
    parser.parse()

    return ParserGenerator(parser)
def get_parser_generator(file_name):
    scanner = MbnfScanner()
    tokens = scanner.scan(argv[2])
    parser = MbnfParser(tokens)
    parser.parse()

    return ParserGenerator(parser)
示例#3
0
from mbnf_scanner import MbnfScanner
from mbnf_parser import MbnfParser
from parser_generator import ParserGenerator


s = MbnfScanner()
tokens = s.scan('grammars/CEG-RR')
print(tokens)
p = MbnfParser(tokens)
p.parse()
pg = ParserGenerator(p)
pg.print_ll1_sets()
pg.print_yaml_ll1_table()

示例#4
0
from mbnf_scanner import MbnfScanner
from mbnf_parser import MbnfParser
from parser_generator import ParserGenerator

s = MbnfScanner()
tokens = s.scan('grammars/CEG-RR')
print(tokens)
p = MbnfParser(tokens)
p.parse()
pg = ParserGenerator(p)
pg.print_ll1_sets()
pg.print_yaml_ll1_table()