Commit 3b7cb2dd authored by 徐世桐's avatar 徐世桐
Browse files

sx119: delete feature of import a standard library

parent 9ff7e162
......@@ -12,9 +12,7 @@ func : type IDENT OPEN_PARENTHESES param_list? CLOSE_PARENTHESES IS stat
param_list : param (COMMA param )* ;
param : type IDENT;
import_file : IMPORT FILE_NAME # ImportUserDefine // import example.hwacc
| IMPORT '<' FILE_NAME '>' # ImportSTDFile// import <FILE_FROM_LIB.hwacc>
;
import_file : IMPORT FILE_NAME;
stat : skp #StatSkipStat // This visitor will be replaced by #SkipStat
......
......@@ -50,7 +50,6 @@ public class SemanticChecker extends WACCParserBaseVisitor<Node> {
/* where the compiling file lives, used for determine include file */
private String path;
private final String STD_PATH = "lib/waccLib/";
/* recording the current SymbolTable during parser tree visits */
private SymbolTable currSymbolTable;
......@@ -240,16 +239,11 @@ public class SemanticChecker extends WACCParserBaseVisitor<Node> {
}
@Override
public Node visitImportUserDefine(ImportUserDefineContext ctx) {
public Node visitImport_file(Import_fileContext ctx) {
visitImport(ctx, path + ctx.FILE_NAME().getText());
return null;
}
@Override
public Node visitImportSTDFile(ImportSTDFileContext ctx) {
visitImport(ctx, STD_PATH + ctx.FILE_NAME().getText());
return null;
}
public void visitImport(ParserRuleContext ctx, String importFile) {
/* detect circular import */
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment