Skip to content

Commit fb4dcf0

Browse files
committed
readme example
1 parent 04560f1 commit fb4dcf0

2 files changed

Lines changed: 31 additions & 1 deletion

File tree

example.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,12 @@ public static void main(String[] a){
77
class 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 ;

readme.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,29 @@
11
# GoLexThatJava
22
This 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+
```

0 commit comments

Comments
 (0)