aboutsummaryrefslogtreecommitdiff
path: root/gcc/m2/bnf/m2-1.bnf
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/m2/bnf/m2-1.bnf')
-rw-r--r--gcc/m2/bnf/m2-1.bnf34
1 files changed, 30 insertions, 4 deletions
diff --git a/gcc/m2/bnf/m2-1.bnf b/gcc/m2/bnf/m2-1.bnf
index 3b3695b8de7..a68908a0bbd 100644
--- a/gcc/m2/bnf/m2-1.bnf
+++ b/gcc/m2/bnf/m2-1.bnf
@@ -89,7 +89,10 @@ FROM P1SymBuild IMPORT P1StartBuildProgramModule,
BuildProcedureHeading,
StartBuildProcedure,
- EndBuildProcedure ;
+ EndBuildProcedure,
+ AddImportToImportStatement,
+ BuildImportStatement ;
+
FROM SymbolTable IMPORT MakeGnuAsm, PutGnuAsmVolatile, PutGnuAsm, PutGnuAsmInput,
PutGnuAsmOutput, PutGnuAsmTrash, PutGnuAsmVolatile,
@@ -990,10 +993,33 @@ Export := "EXPORT" ( "QUALIFIED" % Pus
IdentList | % PushT(ExportTok) %
IdentList ) ";" =:
-Import := "FROM" Ident "IMPORT" IdentList ";" |
- "IMPORT" % PushT(ImportTok)
+Import := "FROM" % BuildImportStatement (GetTokenNo () -1) %
+ Ident % AddImportToImportStatement (TRUE) %
+ "IMPORT" IdentList ";" |
+ "IMPORT" % BuildImportStatement (GetTokenNo () -1) %
+ % PushT(ImportTok)
(* determines whether Ident or Module *) %
- IdentList ";" =:
+ IdentImportList ";" =:
+
+IdentImportList := Ident % VAR
+ on: BOOLEAN ;
+ n : CARDINAL ; %
+ % on := IsAutoPushOn() ;
+ IF on
+ THEN
+ AddImportToImportStatement (FALSE) ;
+ n := 1
+ END %
+ { "," Ident % IF on
+ THEN
+ AddImportToImportStatement (FALSE) ;
+ INC(n)
+ END %
+ } % IF on
+ THEN
+ PushT(n)
+ END %
+ =:
DefinitionModule := "DEFINITION" % M2Error.DefaultDefinitionModule %
"MODULE" % PushAutoOn %