Package net.asfun.jangod.parse

Examples of net.asfun.jangod.parse.TokenParser


    return new SimpleBindings();
  }

  @Override
  public Object eval(String script, ScriptContext ctx) throws ScriptException {
    TokenParser parser = new TokenParser(script);
    JangodInterpreter interpreter = new JangodInterpreter((Context) ctx);
    try {
      return interpreter.render(parser);
    } catch (InterpretException e) {
      throw new ScriptException(e.getMessage());
View Full Code Here


    }
  }

  @Override
  public Object eval(Reader reader, ScriptContext ctx) throws ScriptException {
    TokenParser parser;
    try {
      parser = new TokenParser(reader);
    } catch (ParseException e) {
      throw new ScriptException(e.getMessage());
    }
    JangodInterpreter interpreter = new JangodInterpreter((Context) ctx);
    try {
View Full Code Here

    return factory;
  }

  @Override
  public Object eval(String script) throws ScriptException {
    TokenParser parser = new TokenParser(script);
    JangodInterpreter interpreter = new JangodInterpreter((Context) context);
    try {
      return interpreter.render(parser);
    } catch (InterpretException e) {
      throw new ScriptException(e.getMessage());
View Full Code Here

    }
  }

  @Override
  public Object eval(Reader reader) throws ScriptException {
    TokenParser parser;
    try {
      parser = new TokenParser(reader);
    } catch (ParseException e) {
      throw new ScriptException(e.getMessage());
    }
    JangodInterpreter interpreter = new JangodInterpreter((Context) context);
    try {
View Full Code Here

    }
  }

  @Override
  public Object eval(String script, Bindings n) throws ScriptException {
    TokenParser parser = new TokenParser(script);
    ScriptContext ctx = new JangodContext(factory.globalBindings);
    ctx.setBindings(n, ScriptContext.ENGINE_SCOPE);
    JangodInterpreter interpreter = new JangodInterpreter((Context) ctx);
    try {
      return interpreter.render(parser);
View Full Code Here

    }
  }

  @Override
  public Object eval(Reader reader, Bindings n) throws ScriptException {
    TokenParser parser;
    try {
      parser = new TokenParser(reader);
    } catch (ParseException e) {
      throw new ScriptException(e.getMessage());
    }
   
    ScriptContext ctx = new JangodContext(factory.globalBindings);
View Full Code Here

 
  public Node getParseResult(String file, String encoding) throws IOException {
    String key = file + join + encoding;
    Node root = cache.get(key);
    if ( root == null ) {
      root = TreeParser.parser(new TokenParser(ResourceManager.getResource(file, encoding)));
      root = new TreeRebuilder(application, file).refactor(root);
      cache.put(key, root);
    }
//    TreeIterator nit = new TreeIterator(root);
//    while (nit.hasNext()) {
View Full Code Here

    String templateFile = rebuilder.resolveString(helper[0]);
    try {
      String fullName = ResourceManager.getFullName(templateFile,
          rebuilder.getWorkspace(), rebuilder.getConfiguration().getWorkspace());
      //TODO STOP LOOP INCLUDE
      Node includeRoot = TreeParser.parser( new TokenParser( ResourceManager.getResource(
          fullName, rebuilder.getConfiguration().getEncoding())));
     
//      includeRoot.replaceWithChildren(current);
      rebuilder.nodeReplace(current, includeRoot.children());
    } catch (IOException e) {
View Full Code Here

    String templateFile = rebuilder.resolveString(helper[0]);
    try {
      String fullName = ResourceManager.getFullName(templateFile,
          rebuilder.getWorkspace(), rebuilder.getConfiguration().getWorkspace());
      //TODO STOP LOOP EXTENDS
      Node extendsRoot = TreeParser.parser( new TokenParser( ResourceManager.getResource(
          fullName, rebuilder.getConfiguration().getEncoding())));
      extendsRoot = rebuilder.derive().refactor(extendsRoot);
     
      rebuilder.parent = extendsRoot;
      rebuilder.nodeRemove(current);
View Full Code Here

TOP

Related Classes of net.asfun.jangod.parse.TokenParser

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.