Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void program () {
- if (token_actual.tipo == iniciadores(declarations) || token_actual.tipo == iniciadores(statements)){
- declarations();
- statements();
- }else if(token_actual.tipo == iniciadores(statements)){
- statements();
- }else {
- // error
- }
- }
- void declarations (){
- declaration();
- accept(sym.PyCOMA);
- boolean A = token_actual.tipo == sym.TINT;
- boolean B = token_actual.tipo == sym.TSTRING;
- while(A || B){
- declaration();
- accept(sym.PyCOMA);
- }
- }
- void accept(int token_deseado){
- if(token_actual.tipo != token_deseado){
- // error
- }else {
- token_actual = scanner.next_token();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement