-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
1,872 additions
and
914 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -167,4 +167,4 @@ real | |
|
||
indexing | ||
: ID SQUARE_OPEN expression SQUARE_CLOSE | ||
; | ||
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
public class File { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import java.io.FileInputStream; | ||
import java.io.IOException; | ||
import java.io.InputStream; | ||
import org.antlr.v4.runtime.*; | ||
import org.antlr.v4.runtime.tree.*; | ||
|
||
public class Semantic { | ||
public void execute(String inputFilePath) throws IOException { | ||
typeChecker(inputFilePath); | ||
} | ||
|
||
private void typeChecker(String inputFilePath) throws IOException { | ||
InputStream inputStream = new FileInputStream(inputFilePath); | ||
|
||
@SuppressWarnings("deprecation") | ||
ANTLRInputStream input = new ANTLRInputStream(inputStream); | ||
|
||
SimplexLexer lexer = new SimplexLexer(input); | ||
|
||
CommonTokenStream tokens = new CommonTokenStream(lexer); | ||
|
||
SimplexParser parser = new SimplexParser(tokens); | ||
|
||
ParseTree tree = parser.program(); | ||
|
||
SimplexVisitor simplex = new SimplexVisitor(); | ||
|
||
simplex.visit(tree); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.