File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,8 +7,12 @@ public static void main(String[] a){
77class Fac {
88 public int ComputeFac (int num ){
99 int num_aux ;
10+ // base case
11+
1012 if (num <= 1 )
1113 num_aux = 1 ;
14+ /* else case
15+ */
1216 else
1317 num_aux = num * (this .ComputeFac (num - 1 )) ;
1418 return num_aux ;
Original file line number Diff line number Diff line change 11# GoLexThatJava
22This library is a Lexical Analysis for a minified java syntax.
3- You can find more info about the target syntax in this [ Document] ( ./TP_2022.doc.pdf )
3+ You can find more info about the target syntax in this [ Document] ( ./TP_2022.doc.pdf )
4+ ## Execution example
5+ Running this program on [ example.java] ( ./example.java ) yields:
6+ ```
7+ > go run *.go
8+
9+
10+ ---------- START ----------
11+ class IDENTIFIER{
12+ public static void main(String[] IDENTIFIER){
13+ System.out.println(new IDENTIFIER().IDENTIFIER(INTEGER_LITERAL));
14+ }
15+ }
16+
17+ class IDENTIFIER {
18+ public int IDENTIFIER(int IDENTIFIER){
19+ int IDENTIFIER ;
20+ SINGLE_LINE_COMMENT
21+ if (IDENTIFIER <= INTEGER_LITERAL)
22+ IDENTIFIER = INTEGER_LITERAL ;
23+ MULTI_LINE_COMMENT
24+ else
25+ IDENTIFIER = IDENTIFIER * (this.IDENTIFIER(IDENTIFIER - INTEGER_LITERAL)) ;
26+ return IDENTIFIER ;
27+ }
28+ }
29+ ```
You can’t perform that action at this time.
0 commit comments