4
9
2010
0

tmp

 

void S() throws SyntacticException{
    if(lookahead.equals(new Token('('))){
        match(new Token('('));
        L();
        match(new Token(')'));
    } else if(lookahead.equals(new Token('a'))){
        match(newToken('a'));
    }
}

void L() throws SyntacticException{
    if(lookahead.equals(new Token('('))){
        match(new Token('('));
        L();
        match(new Token(')'));
    } else if(lookahead.equals(new Token('a'))){
        match(newToken('a'));
    }
    Lp();
}

void Lp() throws SyntacticException{
    if(lookahead.equals(new Token(','))){
        match(new Token(','));

        if(lookahead.equals(new Token('('))){
            match(new Token('('));
            L();
            match(new Token(')'));
        }else{
            match(new Token('a'));
        }
        match(Lp);
    }else{
        //good
    }
}

null

Category: 未分类 | Tags: | Read Count: 898

登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter

Host by is-Programmer.com | Power by Chito 1.3.3 beta | Theme: Aeros 2.0 by TheBuckmaker.com