Skip to content

Commit fc5bf0e

Browse files
authored
Merge pull request #4 from TTimeLanguage/isac
Isac
2 parents d3c533d + 54bacd9 commit fc5bf0e

File tree

5 files changed

+56
-4
lines changed

5 files changed

+56
-4
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,7 @@ doc/*
6363
out/*
6464
*.iml
6565
/bin/
66+
.idea/
67+
doc/
68+
out/
69+
test_Code/new.txt

README.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# TTime Language
2+
3+
## Feature
4+
5+
- Based on [CLite](http://myslu.stlawu.edu/~ehar/Spring10/364/clite_grammar.html)
6+
- Support _Time_ as primitive variable
7+
- Support calculation of _Time_ (like +, -)
8+
- Support Array of variable
9+
- Support Global Variable
10+
- Support User-defined Functions
11+
- Support Function Overloading
12+
- Support **for, while, switch** loop
13+
- Support floating point variable(_float_)
14+
15+
## [EBNF](https://github.com/TTimeLanguage/Compiler/blob/isac/src/BNF/TTime_EBNF.pdf)
16+
17+
18+
---
19+
20+
# TTime Language Compiler
21+
22+
It compiles **TTime Language** source code to [U-Code](http://pl.skuniv.ac.kr/Lecture/Compiler/cdt-9/sld022.htm)
23+
24+
## Entry Points
25+
26+
### 1. `CodeGenerator.CodeGenerator`
27+
- code generator
28+
- It returns [U-Code](http://pl.skuniv.ac.kr/Lecture/Compiler/cdt-9/sld022.htm) file
29+
30+
#### Parameter
31+
1. full path of source code
32+
2. full path of result file
33+
34+
### 2. `Lexer.Lexer`
35+
- Just print tokens of given source code
36+
37+
#### Parameter
38+
1. full path of source code
39+
40+
### 3. `Parser.Parser`
41+
- Print AST of given source code
42+
43+
#### Parameter
44+
1. full path of source code
45+
46+
47+
### 4. `Semantic.TypeChecker`
48+
- Print AST if given source code is valid, or print error message
49+
50+
#### Parameter
51+
1. full path of source code
52+

src/BNF/TTime_EBNF.pdf

60.9 KB
Binary file not shown.

src/Syntax/ForStatement.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,6 @@ protected void V(HashMap<String, Init> declarationMap, Type functionType) {
137137
*/
138138
@Override
139139
protected void V(HashMap<String, Init> declarationMap, Statement loopStatement) {
140-
innerV(declarationMap);
141-
142140
statements.V(declarationMap, this);
143141

144142
valid = true;

src/Syntax/WhileStatement.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,6 @@ protected void V(HashMap<String, Init> declarationMap, Type functionType) {
6363
*/
6464
@Override
6565
protected void V(HashMap<String, Init> declarationMap, Statement loopStatement) {
66-
innerV(declarationMap);
67-
6866
statements.V(declarationMap, loopStatement);
6967

7068
valid = true;

0 commit comments

Comments
 (0)