Examples of generateParseTree()


Examples of ptolemy.data.expr.PtParser.generateParseTree()

            Transition transition = (Transition) transitions.next();

            // generate code for guard expression
            String guard = transition.getGuardExpression();
            PtParser parser = new PtParser();
            ASTPtRootNode guardParseTree = parser.generateParseTree(guard);
            ParseTreeCodeGenerator parseTreeCodeGenerator = controllerHelper
                    .getParseTreeCodeGenerator();
            parseTreeCodeGenerator.evaluateParseTree(guardParseTree,
                    controllerHelper._scope);
            codeBuffer.append(parseTreeCodeGenerator.generateFireCode());
View Full Code Here

Examples of ptolemy.data.expr.PtParser.generateParseTree()

     @exception IllegalActionException If the string does not represent
     *   a parsable complex number.
     */
    public ComplexToken(String init) throws IllegalActionException {
        PtParser parser = new PtParser();
        ASTPtRootNode tree = parser.generateParseTree(init);
        Token token = (new ParseTreeEvaluator()).evaluateParseTree(tree);

        if (token instanceof ComplexToken) {
            _value = ((ComplexToken) token).complexValue();
        } else {
View Full Code Here

Examples of ptolemy.data.expr.PtParser.generateParseTree()

            ASTPtRootNode root;

            if (variable.isStringMode()) {
                root = parser.generateStringParseTree(expression);
            } else {
                root = parser.generateParseTree(expression);
            }

            Set freeIdentifiers = new HashSet(collector
                    .collectFreeVariables(root));
View Full Code Here

Examples of ptolemy.data.expr.PtParser.generateParseTree()

                }

                PtParser parser = new PtParser();
                ASTPtRootNode parseTree = null;
                try {
                    parseTree = parser.generateParseTree(variable
                            .getExpression());
                } catch (Throwable throwable) {
                    throw new IllegalActionException(variable, throwable,
                            "Failed to generate parse tree for \"" + name
                                    + "\". in \"" + container + "\"");
View Full Code Here

Examples of ptolemy.data.expr.PtParser.generateParseTree()

     @exception IllegalActionException If the string does
     *   not contain a parsable array.
     */
    public ArrayToken(String init) throws IllegalActionException {
        PtParser parser = new PtParser();
        ASTPtRootNode tree = parser.generateParseTree(init);
        ParseTreeEvaluator evaluator = new ParseTreeEvaluator();
        Token token = evaluator.evaluateParseTree(tree);

        if (token instanceof ArrayToken) {
            _value = ((ArrayToken) token)._value;
View Full Code Here

Examples of ptolemy.data.expr.PtParser.generateParseTree()

     @exception IllegalActionException If the string does
     *   not contain a parsable boolean matrix.
     */
    public BooleanMatrixToken(String init) throws IllegalActionException {
        PtParser parser = new PtParser();
        ASTPtRootNode tree = parser.generateParseTree(init);
        Token token = (new ParseTreeEvaluator()).evaluateParseTree(tree);

        if (token instanceof BooleanMatrixToken) {
            boolean[][] value = ((BooleanMatrixToken) token).booleanMatrix();
            _initialize(value);
View Full Code Here

Examples of ptolemy.data.expr.PtParser.generateParseTree()

            throws PtalonRuntimeException {
        try {
            PtParser parser = new PtParser();

            ParseTreeEvaluator _parseTreeEvaluator = new ParseTreeEvaluator();
            ASTPtRootNode _parseTree = parser.generateParseTree(expression);
            Token result = _parseTreeEvaluator.evaluateParseTree(_parseTree,
                    _scope);
            return result;
        } catch (Exception ex) {
            throw new PtalonRuntimeException("Unable to evaluate expression\n"
View Full Code Here

Examples of ptolemy.data.expr.PtParser.generateParseTree()

     */
    public String evaluateString(String expression) {
        try {
            PtParser parser = new PtParser();
            ParseTreeEvaluator _parseTreeEvaluator = new ParseTreeEvaluator();
            ASTPtRootNode _parseTree = parser.generateParseTree(expression);
            Token result = _parseTreeEvaluator.evaluateParseTree(_parseTree,
                    _scope);
            if (result instanceof StringToken) {
                return ((StringToken) result).stringValue();
            }
View Full Code Here

Examples of ptolemy.data.expr.PtParser.generateParseTree()

                if (transition.getName().equals("default")) {
                    codeBuffer.append("true");
                } else {
                    String guard = transition.getGuardExpression();
                    PtParser parser = new PtParser();
                    ASTPtRootNode guardParseTree = parser
                            .generateParseTree(guard);
                    ParseTreeCodeGenerator parseTreeCodeGenerator = getParseTreeCodeGenerator();
                    parseTreeCodeGenerator.evaluateParseTree(guardParseTree,
                            _scope);
                    codeBuffer
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.