Exemplo n.º 1
0
 def GET(self):
   i = web.input()
   code = i.code
   parser = parser_generator.makeParser(grammar_parser.parse(open('./galaC.grm').read()))
   ast = parser.parse(code)
   desugaredE = bytecode_compiler.desugar(ast)
   return json.dumps(desugaredE)
Exemplo n.º 2
0
 def GET(self):
     i = web.input()
     code = i.code
     parser = parser_generator.makeParser(
         grammar_parser.parse(open('./galaC.grm').read()))
     ast = parser.parse(code)
     desugaredE = bytecode_compiler.desugar(ast)
     return json.dumps(desugaredE)
Exemplo n.º 3
0
 def POST(self):
   i = web.input()
   code = i.code
   callback = i.callback
   parser = parser_generator.makeParser(grammar_parser.parse(open('./galaC.grm').read()))
   ast = parser.parse(code)
   desugaredE = bytecode_compiler.desugar(ast)
   web.header('Content-Type', 'application/javascript') 
   return "%s(%s)" % (callback, json.dumps(desugaredE)) 
Exemplo n.º 4
0
 def GET(self):
     i = web.input()
     code = i.code
     callback = i.jsoncallback
     print callback
     print code
     parser = parser_generator.makeParser(
         grammar_parser.parse(open('./tst.grm').read()))
     ast = parser.parse(code)
     desugaredE = bytecode_compiler.desugar(ast)
     web.header('Content-Type', 'application/javascript')
     return "%s(%s)" % (callback, json.dumps(desugaredE))
Exemplo n.º 5
0
 def GET(self):
   i = web.input()
   code = i.code
   callback = i.jsoncallback
   print code
   parser = parser_generator.makeParser(grammar_parser.parse(open('./spacescript.grm').read()))
   library = parser.parse(open('./library.164').read())
   ast = parser.parse(code)
   #print desugarer.desugar(ast)
   #desugaredE = desugarer.desugar( library + ast)
   desugaredE = bytecode_compiler.desugar(library + ast)
   web.header('Content-Type', 'application/javascript')
   return "%s(%s)" % (callback, json.dumps(desugaredE))