Examples of Interpreter


Examples of com.elega9t.commons.shell.intrprtr.Interpreter

    public void error(Throwable t) {
        outln(interpreter.getName() + ": " + t.getMessage());
    }

    public void nextInterpreter() {
        Interpreter nextInterpreter = interpreterStack.size() == 0 ? null : interpreterStack.pop();
        if(nextInterpreter != null) {
            outln("shell: switching to '" + nextInterpreter.getName() + "' interpreter.");
        }
        interpreter = nextInterpreter;
        EnvironmentProperty.update(this);
    }
View Full Code Here

Examples of com.stuffwithstuff.magpie.interpreter.Interpreter

import com.stuffwithstuff.magpie.parser.MagpieParser;
import com.stuffwithstuff.magpie.util.Pair;

public class Magpie {
  public Magpie(MagpieHost host) {
    mInterpreter = new Interpreter(host);
  }
View Full Code Here

Examples of de.tuhrig.thofu.Interpreter

  @Before
  public void reset() {

    this.parser = new ProceduralParser();
   
    this.interpreter = new Interpreter();
  }
View Full Code Here

Examples of galoot.interpret.Interpreter

        return renderDocument(context).evaluateAsString();
    }

    public Document renderDocument(ContextStack context)
    {
        Interpreter interp = new Interpreter(context);
        templateAST.apply(interp);
        return interp.getDocument();
    }
View Full Code Here

Examples of ij.macro.Interpreter

  }
 
  public static String lookupPathVariable(String path) {
    if (path!=null && path.indexOf(".")==-1 && !((new File(path)).exists())) {
      if (path.startsWith("&")) path=path.substring(1);
      Interpreter interp = Interpreter.getInstance();
      String path2 = interp!=null?interp.getStringVariable(path):null;
      if (path2!=null) path = path2;
    }
    return path;
  }
View Full Code Here

Examples of net.eldiosantos.command.core.Interpreter

  public static void main(String[] args) {
    String cmd;

    Scanner sc = new Scanner(System.in);

    Interpreter interpreter = new Interpreter(new File("/"));

    System.out.println("Console started...");

    do {
      System.out.print("shell: ");
      cmd = sc.nextLine();

      interpreter.parseCommand(cmd);

    } while (!cmd.equals("exit"));
  }
View Full Code Here

Examples of net.fortytwo.ripple.cli.Interpreter

        //connection.close();
    }

    public void put(final InputStream input) throws RippleException {
        // TODO: creating a new Interpreter for each unit of input is not very efficient
        Interpreter interpreter = new Interpreter(recognizerAdapter, input, parserExceptionSink);
        interpreter.parse();

        try {
            input.close();
        } catch (IOException e) {
            throw new RippleException(e);
View Full Code Here

Examples of org.antlr.tool.Interpreter

        Grammar lexer = eg.getLexerGrammar();
        if(lexer == null) {
            throw new RuntimeException("Lexer is null. Check the grammar before running the interpreterTab.");
        }

        Interpreter lexEngine = new CustomInterpreter(lexer, input);


        FilteringTokenStream tokens = new FilteringTokenStream(lexEngine);

        StringTokenizer tk = new StringTokenizer(tokensToIgnoreLabel.getText(), " ");
        while ( tk.hasMoreTokens() ) {
            String tokenName = tk.nextToken();
            tokens.setTokenTypeChannel(lexer.getTokenType(tokenName), Token.HIDDEN_CHANNEL);
        }

        Interpreter parseEngine = new CustomInterpreter(parser, tokens);

        ParseTree t = null;
        try {
            if(ATEToken.isLexerName(startSymbol)) {
                t = lexEngine.parse(startSymbol);
            } else {
                t = parseEngine.parse(startSymbol);
            }
        } catch (Exception e) {
            window.consoleTab.println(e);
        }
View Full Code Here

Examples of org.apache.batik.script.Interpreter

    /**
     * Runs an event handler.
     */
    public void runEventHandler(String script, Event evt, String lang) {
        Interpreter interpreter = bridgeContext.getInterpreter(lang);
        if (interpreter == null) {
            if (userAgent != null) {
                userAgent.displayError
                    (new Exception("unknow language: " + lang));
            }
        }

        interpreter.bindObject(EVENT_NAME, evt);
        interpreter.bindObject(ALTERNATE_EVENT_NAME, evt);
           
        try {
            checkCompatibleScriptURL(lang, docPURL);
            interpreter.evaluate(script);
        } catch (InterpreterException ie) {
            handleInterpreterException(ie);
        } catch (SecurityException se) {
            handleSecurityException(se);
        }
View Full Code Here

Examples of org.apache.batik.script.Interpreter

            }

            //
            // Scripting language invocation.
            //
            Interpreter interpreter = bridgeContext.getInterpreter(type);

            if (interpreter == null) {
                UserAgent ua = bridgeContext.getUserAgent();
                if (ua != null) {
                    ua.displayError(new Exception("Unknown language: "+type));
                }
                return;
            }

            if (!languages.contains(type)) {
                languages.add(type);
                initializeEnvironment(interpreter, type);
            }

            try {
                String href = XLinkSupport.getXLinkHref(script);
                String desc = Messages.getMessage(INLINE_SCRIPT_DESCRIPTION);
                Reader reader;
                if (href.length() > 0) {
                    desc = href;

                    // External script.
                    ParsedURL purl = new ParsedURL
                        (XMLBaseSupport.getCascadedXMLBase(script), href);
                    checkCompatibleScriptURL(type, purl);
                    reader = new InputStreamReader(purl.openStream());
                } else {
                    // Inline script.
                    Node n = script.getFirstChild();
                    if (n != null) {
                        StringBuffer sb = new StringBuffer();
                        while (n != null) {
                            sb.append(n.getNodeValue());
                            n = n.getNextSibling();
                        }
                        reader = new StringReader(sb.toString());
                    } else {
                        continue;
                    }
                }

                interpreter.evaluate(reader, desc);

            } catch (IOException e) {
                if (userAgent != null) {
                    userAgent.displayError(e);
                }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.