-
Notifications
You must be signed in to change notification settings - Fork 0
/
5.1.a_sum_of_two_numbers
22 lines (21 loc) · 2.15 KB
/
5.1.a_sum_of_two_numbers
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
program {
suma(int a, int b) -> int {
return a + b;
}
main() -> void {
print("Suma = ", @suma(10, 5));
}
}
program -1-> PROGRAM LBRACKET program_body RBRACKET
-2-> PROGRAM LBRACKET function_definition main_function RBRACKET
-3-> PROGRAM LBRACKET function_definition 'main' LPAREN RPAREN ARROW VOID block RBRACKET
-9-> PROGRAM LBRACKET function_definition 'main' LPAREN RPAREN ARROW VOID LBRACKET ( statement )* RBRACKET RBRACKET
-10-> PROGRAM LBRACKET function_definition 'main' LPAREN RPAREN ARROW VOID LBRACKET simple_statement SEMICOLON RBRACKET RBRACKET
-11-> PROGRAM LBRACKET function_definition 'main' LPAREN RPAREN ARROW VOID LBRACKET functional_call SEMICOLON RBRACKET RBRACKET //Should have used print statement bout found it at the end and i am not rewriting the whole thing :(
-15-> PROGRAM LBRACKET function_definition 'main' LPAREN RPAREN ARROW VOID LBRACKET AT IDENTIFIER LPAREN ( actual_parameters )? RPAREN SEMICOLON RBRACKET RBRACKET
-21-> PROGRAM LBRACKET function_definition 'main' LPAREN RPAREN ARROW VOID LBRACKET AT IDENTIFIER LPAREN assignable COMMA assignable RPAREN SEMICOLON RBRACKET RBRACKET
-22-26-27-28-29-30-> PROGRAM LBRACKET function_definition 'main' LPAREN RPAREN ARROW VOID LBRACKET AT IDENTIFIER LPAREN INT_LITERAL COMMA INT_LITERAL RPAREN SEMICOLON RBRACKET RBRACKET
-4-> PROGRAM LBRACKET IDENTIFIER LPAREN formal_parameters RPAREN ARROW type 'main' LPAREN RPAREN ARROW VOID LBRACKET AT IDENTIFIER LPAREN INT_LITERAL COMMA INT_LITERAL RPAREN SEMICOLON RBRACKET RBRACKET
-6-7-> PROGRAM LBRACKET IDENTIFIER LPAREN formal_parameters RPAREN ARROW INT 'main' LPAREN RPAREN ARROW VOID LBRACKET AT IDENTIFIER LPAREN INT_LITERAL COMMA INT_LITERAL RPAREN SEMICOLON RBRACKET RBRACKET
-5-> PROGRAM LBRACKET IDENTIFIER LPAREN type IDENTIFIER COMMA type IDENTIFIER RPAREN ARROW INT 'main' LPAREN RPAREN ARROW VOID LBRACKET AT IDENTIFIER LPAREN INT_LITERAL COMMA INT_LITERAL RPAREN SEMICOLON RBRACKET RBRACKET
-6-7->PROGRAM LBRACKET IDENTIFIER LPAREN INT IDENTIFIER COMMA INT IDENTIFIER RPAREN ARROW INT 'main' LPAREN RPAREN ARROW VOID LBRACKET AT IDENTIFIER LPAREN INT_LITERAL COMMA INT_LITERAL RPAREN SEMICOLON RBRACKET RBRACKET