Package org.luaj.vm2.parser

Examples of org.luaj.vm2.parser.LuaParser


    private void fakeWikiBase() {
        // fake http://www.mediawiki.org/wiki/Extension:Wikibase
        final LuaValue mw = globals.get("mw");
        final LuaTable wikibase = new LuaTable();
        wikibase.set("getEntity", new ZeroArgFunction() {
            @Override public LuaValue call() {
                return NIL;
            }
        });
        mw.set("wikibase", wikibase);
View Full Code Here


            }
        };
    }

    private LuaValue isSubsting() {
        return new ZeroArgFunction() {
            @Override public LuaValue call() {
                // TODO
                return FALSE;
            }
        };
View Full Code Here

            }
        };
    }

    private LuaValue incrementExpensiveFunctionCount() {
        return new ZeroArgFunction() {
            @Override public LuaValue call() {
                if (++expensiveFunctionCount > MAX_EXPENSIVE_CALLS) {
                    error("too many expensive function calls");
                }
                return NIL;
View Full Code Here

            }
        };
    }

    private LuaValue getContLangCode() {
        return new ZeroArgFunction() {
            @Override
            public LuaValue call() {
                return valueOf("en");
            }
        };
View Full Code Here

        table.set("getEntityTable", getEntityTable());
        return table;
    }

    private LuaValue getEntityTable() {
        return new ZeroArgFunction() {
            @Override
            public LuaValue call() {
                return NIL;
            }
        };
View Full Code Here

 
  private final Globals globals = new Globals();
  private final PackageLib packageLib;
 
  public LuaInstance() throws AerospikeException {
    globals.load(new JseBaseLib());
    packageLib = new PackageLib();
    globals.load(packageLib);
    //globals.load(new Bit32Lib()); // not needed for 5.1 compatibility 
    globals.load(new TableLib());
    globals.load(new StringLib());
View Full Code Here

    //globals.load(new Bit32Lib()); // not needed for 5.1 compatibility 
    globals.load(new TableLib());
    globals.load(new StringLib());
    globals.load(new CoroutineLib());
    globals.load(new JseMathLib());
    globals.load(new JseIoLib());
    globals.load(new JseOsLib());
    globals.load(new LuajavaLib());
    globals.load(new DebugLib());
    globals.load(new LuaBytesLib(this));
    globals.load(new LuaListLib(this));
View Full Code Here

    globals.load(packageLib);
    //globals.load(new Bit32Lib()); // not needed for 5.1 compatibility 
    globals.load(new TableLib());
    globals.load(new StringLib());
    globals.load(new CoroutineLib());
    globals.load(new JseMathLib());
    globals.load(new JseIoLib());
    globals.load(new JseOsLib());
    globals.load(new LuajavaLib());
    globals.load(new DebugLib());
    globals.load(new LuaBytesLib(this));
View Full Code Here

        System.out.println(
          "pkg="+inf.javapackage+" file="+inf.javaclassname+".java dest="+inf.outfile+" src="+inf.infile);
      FileInputStream in = new FileInputStream(inf.infile);
      FileOutputStream out = new FileOutputStream(inf.outfile);
      PrintWriter pw = new PrintWriter(out);
        LuaParser parser = new LuaParser(in,encoding);
        Chunk chunk = parser.Chunk();
      new JavaCodeGen(chunk,pw,inf.javapackage,inf.javaclassname);
      pw.close();
      out.close();
      in.close();
    } catch ( Throwable t ) {
View Full Code Here

      new File(srcDirname).mkdirs();
      new File(binDirname).mkdirs();
     
      // generate java source
      try {
          LuaParser parser = new LuaParser(stream,"ISO8859-1");
          Chunk chunk = parser.Chunk();
        File source = new File(srcFilename);
          Writer writer = new OutputStreamWriter( new FileOutputStream(source) );
        new JavaCodeGen(chunk,writer,packageName,className);
        writer.close();
         
View Full Code Here

TOP

Related Classes of org.luaj.vm2.parser.LuaParser

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.