Beispiel #1
0
    def _parse(self, text, interpreter=None):
        from nososql.interpreter import Interpreter
        from nososql.lexer import Lexer
        from nososql.parser import Parser

        lookahead_limit = 2

        interp = interpreter or Interpreter()
        parser = Parser(Lexer(text), lookahead_limit, interp)
        return parser.parse()
Beispiel #2
0
    def _parse(self, text, interpreter=None):
        from nososql.interpreter import Interpreter
        from nososql.lexer import Lexer
        from nososql.parser import Parser

        lookahead_limit = 2

        interp = interpreter or Interpreter()
        parser = Parser(Lexer(text), lookahead_limit, interp)
        return parser.parse()
Beispiel #3
0
def main():
    if len(sys.argv) < 2:
        print 'usage: nososql [input file]'
        sys.exit()

    text = open(sys.argv[1]).read()

    lookahead_limit = 2
    interp = Interpreter()
    parser = Parser(Lexer(text), lookahead_limit, interp)
    parser.parse()