Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Statements */
- public static boolean statements(){
- if( statement() && statements() )
- {
- return true;
- }
- if( statements())
- return true;
- return false;
- }
- public static boolean statement(){
- if( simpleStmt() )
- {
- if(tokens.get(index).equals("$SEMICOLON"))
- {
- index++;
- stack.add(level + " ;");
- return true;
- }
- }
- return false;
- }
- public static boolean simpleStmt()
- {
- if( statement_varDeclaration() )
- return true;
- if( statement_assignment( ))
- return true;
- if( io() )
- return true;
- return false;
- }
- public static boolean statement_varDeclaration()
- {
- if( type() )
- {
- if( variable() )
- {
- if(tokens.get(index).equals("$SEMICOLON"))
- {
- index++;
- stack.add(level + " ;");
- return true;
- }
- }
- }
- else if( type())
- {
- if( variable())
- {
- if(tokens.get(index).equals("$ASSIGNMENT"))
- {
- index++;
- stack.add(level + " '='");
- if( expression())
- {
- if(tokens.get(index).equals("$SEMICOLON"))
- {
- index++;
- stack.add(level + " ;");
- return true;
- }
- }
- }
- }
- }
- }
- public static boolean statement_assignment()
- {
- if(variable())
- {
- if( assigment())
- {
- }
- }
- }
- public static boolean io()
- {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement