Package org.codehaus.commons.compiler

Examples of org.codehaus.commons.compiler.Location


     *       [ ExpressionList ]
     *     ')' Statement
     * </pre>
     */
    public Java.Statement parseForStatement() throws CompileException, IOException {
        Location location = this.location();
        this.readKeyword("for");

        this.readOperator("(");

        Java.BlockStatement optionalInit = null;
View Full Code Here


     * <pre>
     *   WhileStatement := 'while' '(' Expression ')' Statement
     * </pre>
     */
    public Java.Statement parseWhileStatement() throws CompileException, IOException {
        Location location = this.location();
        this.readKeyword("while");

        this.readOperator("(");
        Java.Rvalue condition = this.parseExpression().toRvalueOrPE();
        this.readOperator(")");
View Full Code Here

     * <pre>
     *   DoStatement := 'do' Statement 'while' '(' Expression ')' ';'
     * </pre>
     */
    public Java.Statement parseDoStatement() throws CompileException, IOException {
        Location location = this.location();
        this.readKeyword("do");

        Java.Statement body = this.parseStatement();

        this.readKeyword("while");
View Full Code Here

     *
     *   Finally := 'finally' Block
     * </pre>
     */
    public Java.Statement parseTryStatement() throws CompileException, IOException {
        Location location = this.location();
        this.readKeyword("try");

        Java.Block body = this.parseBlock();

        // { CatchClause }
        List ccs = new ArrayList();
        while (this.peekKeyword("catch")) {
            Location loc = this.location();
            this.eatToken();
            this.readOperator("(");
            Java.FunctionDeclarator.FormalParameter caughtException = this.parseFormalParameter();
            this.readOperator(")");
            ccs.add(new Java.CatchClause(
View Full Code Here

     *
     *   SwitchLabel := 'case' Expression ':' | 'default' ':'
     * </pre>
     */
    public Java.Statement parseSwitchStatement() throws CompileException, IOException {
        Location location = this.location();
        this.readKeyword("switch");

        this.readOperator("(");
        Java.Rvalue condition = this.parseExpression().toRvalueOrPE();
        this.readOperator(")");

        this.readOperator("{");
        List sbsgs = new ArrayList();
        while (!this.peekOperator("}")) {
            Location location2 = this.location();
            boolean hasDefaultLabel = false;
            List caseLabels = new ArrayList();
            do {
                if (this.peekKeyword("case")) {
                    this.eatToken();
View Full Code Here

     *   SynchronizedStatement :=
     *     'synchronized' '(' expression ')' Block
     * </pre>
     */
    public Java.Statement parseSynchronizedStatement() throws CompileException, IOException {
        Location location = this.location();
        this.readKeyword("synchronized");
        this.readOperator("(");
        Java.Rvalue expression = this.parseExpression().toRvalueOrPE();
        this.readOperator(")");
        return new Java.SynchronizedStatement(
View Full Code Here

     * <pre>
     *   ReturnStatement := 'return' [ Expression ] ';'
     * </pre>
     */
    public Java.Statement parseReturnStatement() throws CompileException, IOException {
        Location location = this.location();
        this.readKeyword("return");
        Java.Rvalue returnValue = this.peekOperator(";") ? null : this.parseExpression().toRvalueOrPE();
        this.readOperator(";");
        return new Java.ReturnStatement(location, returnValue);
    }
View Full Code Here

     * <pre>
     *   ThrowStatement := 'throw' Expression ';'
     * </pre>
     */
    public Java.Statement parseThrowStatement() throws CompileException, IOException {
        Location location = this.location();
        this.readKeyword("throw");
        final Java.Rvalue expression = this.parseExpression().toRvalueOrPE();
        this.readOperator(";");

        return new Java.ThrowStatement(location, expression);
View Full Code Here

     * <pre>
     *   BreakStatement := 'break' [ Identifier ] ';'
     * </pre>
     */
    public Java.Statement parseBreakStatement() throws CompileException, IOException {
        Location location = this.location();
        this.readKeyword("break");
        String optionalLabel = null;
        if (this.scanner.peek().isIdentifier()) optionalLabel = this.readIdentifier();
        this.readOperator(";");
        return new Java.BreakStatement(location, optionalLabel);
View Full Code Here

     * <pre>
     *   ContinueStatement := 'continue' [ Identifier ] ';'
     * </pre>
     */
    public Java.Statement parseContinueStatement() throws CompileException, IOException {
        Location location = this.location();
        this.readKeyword("continue");
        String optionalLabel = null;
        if (this.scanner.peek().isIdentifier()) optionalLabel = this.readIdentifier();
        this.readOperator(";");
        return new Java.ContinueStatement(location, optionalLabel);
View Full Code Here

TOP

Related Classes of org.codehaus.commons.compiler.Location

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.