예제 #1
0
        public blockAST parseBlock()
        {
            listStatementsAST temp   = null;
            listStatementsAST result = null;
            statementAST      parS;

            accept(sym.COR_A, "{");
            Boolean ind = false;

            while (currentToken.sym == sym.ID)
            {
                if (ind == false)
                {
                    parS = parseStat();
                    temp = new unStatementAST(parS);
                    ind  = true;
                }
                else
                {
                    parS   = parseStat();
                    temp   = new unStatementAST(parS);
                    result = new varStatementAST(result, temp);
                }
            }
            accept(sym.COR_C, "}");
            if (ind == false)
            {
                return(new blockSinStatementAST());
            }
            else
            {
                if (result == null)
                {
                    return(new blockConStatementAST(temp));
                }
                else
                {
                    return(new blockConStatementAST(result));
                }
            }
        }
예제 #2
0
 public blockStatementAST(listStatementsAST l)
 {
     this.listStatements = l;
 }
예제 #3
0
 public blockStatementAST(listStatementsAST l)
 {
     this.listStatements = l;
 }
예제 #4
0
 public blockConStatementAST(listStatementsAST l)
 {
     this.listStatetment = l;
 }
예제 #5
0
 public varStatementAST(listStatementsAST hh1, listStatementsAST hh2)
 {
     h1 = hh1;
     h2 = hh2;
 }