diff options
Diffstat (limited to 'src/ast')
29 files changed, 99 insertions, 109 deletions
diff --git a/src/ast/Python3VisitorImpl.java b/src/ast/Python3VisitorImpl.java index 0783409..604c8d2 100644 --- a/src/ast/Python3VisitorImpl.java +++ b/src/ast/Python3VisitorImpl.java @@ -1,13 +1,10 @@ -package com.clp.project.ast; +package ast; import java.util.ArrayList; -import java.util.List; -import com.clp.project.ast.*; -import com.clp.project.ast.nodes.*; -import com.clp.project.ast.types.*; -import com.clp.project.parser.Python3ParserBaseVisitor; -import com.clp.project.parser.Python3Parser.*; +import ast.nodes.*; +import parser.Python3ParserBaseVisitor; +import parser.Python3Parser.*; import org.antlr.v4.runtime.tree.TerminalNode; /** diff --git a/src/ast/nodes/ArglistNode.java b/src/ast/nodes/ArglistNode.java index 8a5b4b9..f0c33e1 100644 --- a/src/ast/nodes/ArglistNode.java +++ b/src/ast/nodes/ArglistNode.java @@ -1,10 +1,10 @@ -package com.clp.project.ast.nodes; +package ast.nodes; import java.util.ArrayList; -import com.clp.project.semanticanalysis.SemanticError; -import com.clp.project.semanticanalysis.SymbolTable; -import com.clp.project.ast.types.*; +import semanticanalysis.SemanticError; +import semanticanalysis.SymbolTable; +import ast.types.*; /** * Node for the `arglist` statement of the grammar. diff --git a/src/ast/nodes/AssignmentNode.java b/src/ast/nodes/AssignmentNode.java index d722f41..627e842 100644 --- a/src/ast/nodes/AssignmentNode.java +++ b/src/ast/nodes/AssignmentNode.java @@ -1,10 +1,10 @@ -package com.clp.project.ast.nodes; +package ast.nodes; import java.util.ArrayList; -import com.clp.project.semanticanalysis.SemanticError; -import com.clp.project.semanticanalysis.SymbolTable; -import com.clp.project.ast.types.*; +import semanticanalysis.SemanticError; +import semanticanalysis.SymbolTable; +import ast.types.*; /** * Node for the `assignment` statement of the grammar. diff --git a/src/ast/nodes/AtomNode.java b/src/ast/nodes/AtomNode.java index fa81f92..4dcb926 100644 --- a/src/ast/nodes/AtomNode.java +++ b/src/ast/nodes/AtomNode.java @@ -1,10 +1,10 @@ -package com.clp.project.ast.nodes; +package ast.nodes; import java.util.ArrayList; -import com.clp.project.semanticanalysis.SemanticError; -import com.clp.project.semanticanalysis.SymbolTable; -import com.clp.project.ast.types.*; +import semanticanalysis.SemanticError; +import semanticanalysis.SymbolTable; +import ast.types.*; /** * Node for the `atom` statement of the grammar. diff --git a/src/ast/nodes/AugassignNode.java b/src/ast/nodes/AugassignNode.java index 3519b50..629fbcd 100644 --- a/src/ast/nodes/AugassignNode.java +++ b/src/ast/nodes/AugassignNode.java @@ -1,11 +1,11 @@ -package com.clp.project.ast.nodes; +package ast.nodes; import java.util.ArrayList; -import com.clp.project.semanticanalysis.SemanticError; -import com.clp.project.semanticanalysis.SymbolTable; +import semanticanalysis.SemanticError; +import semanticanalysis.SymbolTable; -import com.clp.project.ast.types.*; +import ast.types.*; import org.antlr.v4.runtime.tree.TerminalNode; /** diff --git a/src/ast/nodes/BlockNode.java b/src/ast/nodes/BlockNode.java index 1fdfcc3..6b07f49 100644 --- a/src/ast/nodes/BlockNode.java +++ b/src/ast/nodes/BlockNode.java @@ -1,16 +1,14 @@ -package com.clp.project.ast.nodes; +package ast.nodes; import java.util.ArrayList; -import com.clp.project.semanticanalysis.SemanticError; -import com.clp.project.semanticanalysis.SymbolTable; -import com.clp.project.ast.types.*; +import ast.types.*; /** * Node for `block` statement of the grammar. * It extends the `RootNode`. */ -public class BlockNode extends RootNode implements Node { +public class BlockNode extends RootNode { public BlockNode(ArrayList<Node> stmts, ArrayList<Node> compoundStmts) { super(stmts, compoundStmts); } diff --git a/src/ast/nodes/CompNode.java b/src/ast/nodes/CompNode.java index 6deb51c..33976bf 100644 --- a/src/ast/nodes/CompNode.java +++ b/src/ast/nodes/CompNode.java @@ -1,10 +1,10 @@ -package com.clp.project.ast.nodes; +package ast.nodes; import java.util.ArrayList; -import com.clp.project.semanticanalysis.SemanticError; -import com.clp.project.semanticanalysis.SymbolTable; -import com.clp.project.ast.types.*; +import semanticanalysis.SemanticError; +import semanticanalysis.SymbolTable; +import ast.types.*; import org.antlr.v4.runtime.tree.TerminalNode; /** diff --git a/src/ast/nodes/CompoundNode.java b/src/ast/nodes/CompoundNode.java index bfa0523..e64be9e 100644 --- a/src/ast/nodes/CompoundNode.java +++ b/src/ast/nodes/CompoundNode.java @@ -1,10 +1,10 @@ -package com.clp.project.ast.nodes; +package ast.nodes; import java.util.ArrayList; -import com.clp.project.semanticanalysis.SemanticError; -import com.clp.project.semanticanalysis.SymbolTable; -import com.clp.project.ast.types.*; +import semanticanalysis.SemanticError; +import semanticanalysis.SymbolTable; +import ast.types.*; /** * Node for the `compound_node` statement of the grammar. diff --git a/src/ast/nodes/DottedNameNode.java b/src/ast/nodes/DottedNameNode.java index 342950a..46d1b61 100644 --- a/src/ast/nodes/DottedNameNode.java +++ b/src/ast/nodes/DottedNameNode.java @@ -1,10 +1,10 @@ -package com.clp.project.ast.nodes; +package ast.nodes; import java.util.ArrayList; -import com.clp.project.semanticanalysis.SemanticError; -import com.clp.project.semanticanalysis.SymbolTable; -import com.clp.project.ast.types.*; +import semanticanalysis.SemanticError; +import semanticanalysis.SymbolTable; +import ast.types.*; import org.antlr.v4.runtime.tree.TerminalNode; /** diff --git a/src/ast/nodes/ExprNode.java b/src/ast/nodes/ExprNode.java index 3aa112f..25c2016 100644 --- a/src/ast/nodes/ExprNode.java +++ b/src/ast/nodes/ExprNode.java @@ -1,10 +1,10 @@ -package com.clp.project.ast.nodes; +package ast.nodes; import java.util.ArrayList; -import com.clp.project.semanticanalysis.SemanticError; -import com.clp.project.semanticanalysis.SymbolTable; -import com.clp.project.ast.types.*; +import semanticanalysis.SemanticError; +import semanticanalysis.SymbolTable; +import ast.types.*; /** * Node for the `expr` statement of the grammar. diff --git a/src/ast/nodes/ForStmtNode.java b/src/ast/nodes/ForStmtNode.java index 69dee74..6d94bb2 100644 --- a/src/ast/nodes/ForStmtNode.java +++ b/src/ast/nodes/ForStmtNode.java @@ -1,10 +1,10 @@ -package com.clp.project.ast.nodes; +package ast.nodes; import java.util.ArrayList; -import com.clp.project.semanticanalysis.SemanticError; -import com.clp.project.semanticanalysis.SymbolTable; -import com.clp.project.ast.types.*; +import semanticanalysis.SemanticError; +import semanticanalysis.SymbolTable; +import ast.types.*; /** * Node for the `for_stmt` statement of the grammar. diff --git a/src/ast/nodes/FuncdefNode.java b/src/ast/nodes/FuncdefNode.java index c48eb1c..67bc772 100644 --- a/src/ast/nodes/FuncdefNode.java +++ b/src/ast/nodes/FuncdefNode.java @@ -1,10 +1,10 @@ -package com.clp.project.ast.nodes; +package ast.nodes; import java.util.ArrayList; -import com.clp.project.semanticanalysis.SemanticError; -import com.clp.project.semanticanalysis.SymbolTable; -import com.clp.project.ast.types.*; +import semanticanalysis.SemanticError; +import semanticanalysis.SymbolTable; +import ast.types.*; import org.antlr.v4.runtime.tree.TerminalNode; /** diff --git a/src/ast/nodes/IfNode.java b/src/ast/nodes/IfNode.java index a4f160d..50dde4a 100644 --- a/src/ast/nodes/IfNode.java +++ b/src/ast/nodes/IfNode.java @@ -1,10 +1,10 @@ -package com.clp.project.ast.nodes; +package ast.nodes; import java.util.ArrayList; -import com.clp.project.semanticanalysis.SemanticError; -import com.clp.project.semanticanalysis.SymbolTable; -import com.clp.project.ast.types.*; +import semanticanalysis.SemanticError; +import semanticanalysis.SymbolTable; +import ast.types.*; /** * Node for the `if` statement of the grammar. diff --git a/src/ast/nodes/ImportNode.java b/src/ast/nodes/ImportNode.java index e6ac8c7..e264c99 100644 --- a/src/ast/nodes/ImportNode.java +++ b/src/ast/nodes/ImportNode.java @@ -1,10 +1,10 @@ -package com.clp.project.ast.nodes; +package ast.nodes; import java.util.ArrayList; -import com.clp.project.semanticanalysis.SemanticError; -import com.clp.project.semanticanalysis.SymbolTable; -import com.clp.project.ast.types.*; +import semanticanalysis.SemanticError; +import semanticanalysis.SymbolTable; +import ast.types.*; /** * Node for the `import_stmt` statement of the grammar. diff --git a/src/ast/nodes/Node.java b/src/ast/nodes/Node.java index f807745..949531e 100644 --- a/src/ast/nodes/Node.java +++ b/src/ast/nodes/Node.java @@ -1,10 +1,10 @@ -package com.clp.project.ast.nodes; +package ast.nodes; import java.util.ArrayList; -import com.clp.project.semanticanalysis.SemanticError; -import com.clp.project.semanticanalysis.SymbolTable; -import com.clp.project.ast.types.*; +import semanticanalysis.SemanticError; +import semanticanalysis.SymbolTable; +import ast.types.*; /** * Base interface for a Node. diff --git a/src/ast/nodes/ParamdefNode.java b/src/ast/nodes/ParamdefNode.java index d8e04f7..481282e 100644 --- a/src/ast/nodes/ParamdefNode.java +++ b/src/ast/nodes/ParamdefNode.java @@ -1,17 +1,12 @@ -package com.clp.project.ast.nodes; +package ast.nodes; -import java.util.ArrayList; - -import com.clp.project.semanticanalysis.SemanticError; -import com.clp.project.semanticanalysis.SymbolTable; - -import com.clp.project.ast.types.*; +import ast.types.*; /** * Node for the `paramdef` statement of the grammar. Extends the `AtomNode` * class. */ -public class ParamdefNode extends AtomNode implements Node { +public class ParamdefNode extends AtomNode { public ParamdefNode(String val) { super(val); } diff --git a/src/ast/nodes/ParamlistNode.java b/src/ast/nodes/ParamlistNode.java index d4f40b8..144eb13 100644 --- a/src/ast/nodes/ParamlistNode.java +++ b/src/ast/nodes/ParamlistNode.java @@ -1,10 +1,10 @@ -package com.clp.project.ast.nodes; +package ast.nodes; import java.util.ArrayList; -import com.clp.project.semanticanalysis.SemanticError; -import com.clp.project.semanticanalysis.SymbolTable; -import com.clp.project.ast.types.*; +import semanticanalysis.SemanticError; +import semanticanalysis.SymbolTable; +import ast.types.*; /** * Node for the `param_list` statement of the grammar. diff --git a/src/ast/nodes/ReturnStmtNode.java b/src/ast/nodes/ReturnStmtNode.java index 0cfd2b4..0f2dd74 100644 --- a/src/ast/nodes/ReturnStmtNode.java +++ b/src/ast/nodes/ReturnStmtNode.java @@ -1,10 +1,10 @@ -package com.clp.project.ast.nodes; +package ast.nodes; import java.util.ArrayList; -import com.clp.project.semanticanalysis.SemanticError; -import com.clp.project.semanticanalysis.SymbolTable; -import com.clp.project.ast.types.*; +import semanticanalysis.SemanticError; +import semanticanalysis.SymbolTable; +import ast.types.*; /** * Node for the `return_stmt` statement of the grammar. diff --git a/src/ast/nodes/RootNode.java b/src/ast/nodes/RootNode.java index 12d2f22..e0989e8 100644 --- a/src/ast/nodes/RootNode.java +++ b/src/ast/nodes/RootNode.java @@ -1,10 +1,10 @@ -package com.clp.project.ast.nodes; +package ast.nodes; import java.util.ArrayList; -import com.clp.project.semanticanalysis.SemanticError; -import com.clp.project.semanticanalysis.SymbolTable; -import com.clp.project.ast.types.*; +import semanticanalysis.SemanticError; +import semanticanalysis.SymbolTable; +import ast.types.*; /** * Node for the `root` statement of the grammar. diff --git a/src/ast/nodes/SimpleStmtNode.java b/src/ast/nodes/SimpleStmtNode.java index 3f4dec3..5f844cb 100644 --- a/src/ast/nodes/SimpleStmtNode.java +++ b/src/ast/nodes/SimpleStmtNode.java @@ -1,10 +1,10 @@ -package com.clp.project.ast.nodes; +package ast.nodes; import java.util.ArrayList; -import com.clp.project.semanticanalysis.SemanticError; -import com.clp.project.semanticanalysis.SymbolTable; -import com.clp.project.ast.types.*; +import semanticanalysis.SemanticError; +import semanticanalysis.SymbolTable; +import ast.types.*; /** * Node for the `simple_stmt` statement of the grammar. diff --git a/src/ast/nodes/SimpleStmtsNode.java b/src/ast/nodes/SimpleStmtsNode.java index c8013a3..66c8e2c 100644 --- a/src/ast/nodes/SimpleStmtsNode.java +++ b/src/ast/nodes/SimpleStmtsNode.java @@ -1,10 +1,10 @@ -package com.clp.project.ast.nodes; +package ast.nodes; import java.util.ArrayList; -import com.clp.project.semanticanalysis.SemanticError; -import com.clp.project.semanticanalysis.SymbolTable; -import com.clp.project.ast.types.*; +import semanticanalysis.SemanticError; +import semanticanalysis.SymbolTable; +import ast.types.*; /** * Node for the `simple_stmts` statement of the grammar. diff --git a/src/ast/nodes/TrailerNode.java b/src/ast/nodes/TrailerNode.java index fa7e1ed..b0a0ee7 100644 --- a/src/ast/nodes/TrailerNode.java +++ b/src/ast/nodes/TrailerNode.java @@ -1,10 +1,10 @@ -package com.clp.project.ast.nodes; +package ast.nodes; import java.util.ArrayList; -import com.clp.project.semanticanalysis.SemanticError; -import com.clp.project.semanticanalysis.SymbolTable; -import com.clp.project.ast.types.*; +import semanticanalysis.SemanticError; +import semanticanalysis.SymbolTable; +import ast.types.*; import org.antlr.v4.runtime.tree.TerminalNode; /** diff --git a/src/ast/nodes/WhileStmtNode.java b/src/ast/nodes/WhileStmtNode.java index a84d60e..6353ec1 100644 --- a/src/ast/nodes/WhileStmtNode.java +++ b/src/ast/nodes/WhileStmtNode.java @@ -1,10 +1,10 @@ -package com.clp.project.ast.nodes; +package ast.nodes; import java.util.ArrayList; -import com.clp.project.semanticanalysis.SemanticError; -import com.clp.project.semanticanalysis.SymbolTable; -import com.clp.project.ast.types.*; +import semanticanalysis.SemanticError; +import semanticanalysis.SymbolTable; +import ast.types.*; /** * Node for the `while_stmt` statement of the grammar. diff --git a/src/ast/types/AtomType.java b/src/ast/types/AtomType.java index a44a06c..0387ec1 100644 --- a/src/ast/types/AtomType.java +++ b/src/ast/types/AtomType.java @@ -1,4 +1,4 @@ -package com.clp.project.ast.types; +package ast.types; /** * An tom type. diff --git a/src/ast/types/BoolType.java b/src/ast/types/BoolType.java index 7fc28ee..20c2750 100644 --- a/src/ast/types/BoolType.java +++ b/src/ast/types/BoolType.java @@ -1,4 +1,4 @@ -package com.clp.project.ast.types; +package ast.types; /** * A boolean type. A bool is True or False. diff --git a/src/ast/types/ErrorType.java b/src/ast/types/ErrorType.java index 30cb70e..4a7a0cf 100644 --- a/src/ast/types/ErrorType.java +++ b/src/ast/types/ErrorType.java @@ -1,4 +1,4 @@ -package com.clp.project.ast.types; +package ast.types; /** * Error type. diff --git a/src/ast/types/IntType.java b/src/ast/types/IntType.java index 9f4b250..a29518b 100644 --- a/src/ast/types/IntType.java +++ b/src/ast/types/IntType.java @@ -1,4 +1,4 @@ -package com.clp.project.ast.types; +package ast.types; /** * An integer type. diff --git a/src/ast/types/Type.java b/src/ast/types/Type.java index 4756255..6bff8b9 100644 --- a/src/ast/types/Type.java +++ b/src/ast/types/Type.java @@ -1,10 +1,10 @@ -package com.clp.project.ast.types; +package ast.types; import java.util.ArrayList; -import com.clp.project.semanticanalysis.SemanticError; -import com.clp.project.semanticanalysis.SymbolTable; -import com.clp.project.ast.nodes.*; +import semanticanalysis.SemanticError; +import semanticanalysis.SymbolTable; +import ast.nodes.*; /** * A node which represents a type class. diff --git a/src/ast/types/VoidType.java b/src/ast/types/VoidType.java index 766aee2..d15933f 100644 --- a/src/ast/types/VoidType.java +++ b/src/ast/types/VoidType.java @@ -1,4 +1,4 @@ -package com.clp.project.ast.types; +package ast.types; /** * A void type. Voids return nothing. |