Package com.creativewidgetworks.goldparser.engine

Examples of com.creativewidgetworks.goldparser.engine.ParserException


     * @param msg to add to the errors list
     * @throws ParserException
     */
    public void raiseParserException(String msg) throws ParserException {
        addErrorMessage(msg);
        throw new ParserException(msg);
    }
View Full Code Here


     * @param throwable
     * @throws ParserException
     */
    public void raiseParserException(String msg, Throwable cause) throws ParserException {
        addErrorMessage(msg);
        throw new ParserException(msg, cause);
    }
View Full Code Here

                raiseParserException(FormatHelper.formatMessage("messages", "error.handler_create", ruleName), e);
            } catch (Throwable t) {
                raiseParserException(FormatHelper.formatMessage("messages", "error.handler_create", ruleName), t);
            }
        } else {
            throw new ParserException(FormatHelper.formatMessage("messages", "error.handler_none", ruleName));
        }

        return reduction;
    }
View Full Code Here

     * @param msg to add to the errors list
     * @throws ParserException
     */
    public void raiseParserException(String msg) throws ParserException {
        addErrorMessage(msg);
        throw new ParserException(msg);
    }
View Full Code Here

     * @param throwable
     * @throws ParserException
     */
    public void raiseParserException(String msg, Throwable cause) throws ParserException {
        addErrorMessage(msg);
        throw new ParserException(msg, cause);
    }
View Full Code Here

                raiseParserException(FormatHelper.formatMessage("messages", "error.handler_create", ruleName), e);
            } catch (Throwable t) {
                raiseParserException(FormatHelper.formatMessage("messages", "error.handler_create", ruleName), t);
            }
        } else {
            throw new ParserException(FormatHelper.formatMessage("messages", "error.handler_none", ruleName));
        }

        return reduction;
    }
View Full Code Here

     * @param msg to add to the errors list
     * @throws ParserException
     */
    public void raiseParserException(String msg) throws ParserException {
        addErrorMessage(msg);
        throw new ParserException(msg);
    }
View Full Code Here

     * @param throwable
     * @throws ParserException
     */
    public void raiseParserException(String msg, Throwable cause) throws ParserException {
        addErrorMessage(msg);
        throw new ParserException(msg, cause);
    }
View Full Code Here

                raiseParserException(FormatHelper.formatMessage("messages", "error.handler_create", ruleName), e);
            } catch (Throwable t) {
                raiseParserException(FormatHelper.formatMessage("messages", "error.handler_create", ruleName), t);
            }
        } else {
            throw new ParserException(FormatHelper.formatMessage("messages", "error.handler_none", ruleName));
        }

        return reduction;
    }
View Full Code Here

                List<String> parameters = fn.getParameters();

                // Make sure we have the proper number of calling parameters
                if (parameters.size() != arguments.size()) {
                    throw new ParserException(Simple3.formatMessage("error.function_argument_count",
                        String.valueOf(parameters.size()), String.valueOf(arguments.size())));
                }

                // Set the function parameters -- these will be stored under the function's
                // scope and will not be visible outside of the function. Any variables
                // in other scopes having the same name will not be visible to the function.
                for (int i = 0; i < parameters.size(); i++) {
                    theParser.setProgramVariable(parameters.get(i), arguments.get(i).getValue());
                }

                Reduction statements = fn.getStatements();
                if (statements != null) {
                    statements.execute();
                    var = statements.getValue();
                }

                // Simple3 doesn't allow a simple RETURN without a value hence this
                // path will never be executed.  The code remains to support other
                // syntaxes that allow an empty return statement.  These lines of
                // code will be flagged as untested by the coverage tool when the
                // Simple3 tests are run.
                if (var == null) {
                    var = new Variable("");
                }
            } else {
                throw new ParserException(Simple3.formatMessage("error.function_undefined", functionName));
            }

            return var;

        } finally {
View Full Code Here

TOP

Related Classes of com.creativewidgetworks.goldparser.engine.ParserException

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.