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()
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()