Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
E-language compiler
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sellami Youssef
E-language compiler
Commits
b0d4b068
Commit
b0d4b068
authored
1 month ago
by
Sellami Youssef
Browse files
Options
Downloads
Patches
Plain Diff
grammar correction : an instruction can be a block
parent
6df998ce
No related branches found
Branches containing commit
No related tags found
1 merge request
!2
Master
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
expr_grammar_action.g
+3
-2
3 additions, 2 deletions
expr_grammar_action.g
with
3 additions
and
2 deletions
expr_grammar_action.g
+
3
−
2
View file @
b0d4b068
...
...
@@ -33,7 +33,7 @@ rules
S -> FUNDEFS SYM_EOF { Node(Tlistglobdef, $1) }
FUNDEFS -> FUNDEF FUNDEFS { Node(Tfundef, $1)::$2 }
FUNDEFS -> { [] }
FUNDEF -> IDENTIFIER SYM_LPARENTHESIS LPARAMS SYM_RPARENTHESIS
SYM_LBRACE LINSTRS SYM_RBRACE
{ [Node(Tfunname, [$1]); Node(Tfunargs, $3); Node(Tfunbody, [$
6
])] }
FUNDEF -> IDENTIFIER SYM_LPARENTHESIS LPARAMS SYM_RPARENTHESIS
INSTR
{ [Node(Tfunname, [$1]); Node(Tfunargs, $3); Node(Tfunbody, [$
5
])] }
LPARAMS -> IDENTIFIER REST_PARAMS { $1::$2 }
LPARAMS -> { [] }
...
...
@@ -46,10 +46,11 @@ INSTRS -> INSTR INSTRS { $1::$2 }
INSTRS -> { [] }
INSTR -> SYM_IF SYM_LPARENTHESIS EXPR SYM_RPARENTHESIS SYM_LBRACE LINSTRS SYM_RBRACE ELSE { Node(Tif, [$3; $6; $8]) }
INSTR -> SYM_WHILE SYM_LPARENTHESIS EXPR SYM_RPARENTHESIS
SYM_LBRACE LINSTRS SYM_RBRACE
{ Node(Twhile, [$3; $
6
]) }
INSTR -> SYM_WHILE SYM_LPARENTHESIS EXPR SYM_RPARENTHESIS
INSTR
{ Node(Twhile, [$3; $
5
]) }
INSTR -> SYM_RETURN EXPR SYM_SEMICOLON { Node(Treturn, [$2]) }
INSTR -> SYM_PRINT SYM_LPARENTHESIS EXPR SYM_RPARENTHESIS SYM_SEMICOLON { Node(Tprint, [$3]) }
INSTR -> IDENTIFIER SYM_ASSIGN EXPR SYM_SEMICOLON { Node(Tassign, [$1; $3]) }
INSTR -> SYM_LBRACE LINSTRS SYM_RBRACE { $2 }
ELSE -> SYM_ELSE SYM_LBRACE LINSTRS SYM_RBRACE { $3 }
ELSE -> { NullLeaf }
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment