added files and update
This commit is contained in:
parent
33be23abc2
commit
b8d25b4d51
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_19" default="true" project-jdk-name="19" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_18" default="true" project-jdk-name="openjdk-18" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
</project>
|
3
src/LexicalAnalyzer.java
Normal file
3
src/LexicalAnalyzer.java
Normal file
@ -0,0 +1,3 @@
|
||||
public class LexicalAnalyzer {
|
||||
|
||||
}
|
10
src/edu/jt_kb/cs4308/compiler/JavaSyntaxAnalyzer.java
Normal file
10
src/edu/jt_kb/cs4308/compiler/JavaSyntaxAnalyzer.java
Normal file
@ -0,0 +1,10 @@
|
||||
package edu.jt_kb.cs4308.compiler;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class JavaSyntaxAnalyzer {
|
||||
List<String> KeyWords=new ArrayList<>(Arrays.asList("public","class","static","void","int"));
|
||||
|
||||
}
|
@ -2,7 +2,8 @@ package edu.jt_kb.cs4308.compiler.models;
|
||||
|
||||
public enum TokenType {
|
||||
INT_LIT(10),IDENT(11),ASSIGN_OP(20),ADD_OP(21),SUB_OP(22),MULT_OP(23),
|
||||
DIV_OP(24),LEFT_PAREN(26),RIGHT_PAREN(27),SEMI_COLON(28);
|
||||
DIV_OP(24),LEFT_PAREN(26),RIGHT_PAREN(27),SEMI_COLON(28), STRING_LITERAL(29),
|
||||
COMMA(30), LEFT_CURLY(31), RIGHT_CURLY(32), LEFT_SQUARE(33), RIGHT_SQUARE(34);
|
||||
|
||||
|
||||
public final int value; /* represents which Token you are referencing. */
|
||||
|
Reference in New Issue
Block a user