Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
comp2212-cw-2021
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
PLC
comp2212-cw-2021
Commits
29f6828b
Commit
29f6828b
authored
4 years ago
by
pm3g19
Browse files
Options
Downloads
Patches
Plain Diff
Created grammar for simple version of the language
parent
1d408e81
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Lexer.x
+4
-0
4 additions, 0 deletions
Lexer.x
Parser.y
+28
-0
28 additions, 0 deletions
Parser.y
with
32 additions
and
0 deletions
Lexer.x
0 → 100644
+
4
−
0
View file @
29f6828b
--tokens
.in
.out
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Parser.y
0 → 100644
+
28
−
0
View file @
29f6828b
Prog : .in SetNames .out SetFuncCalls
SetNames : SetName
| SetName, SetNames
VarNames : VarName
| VarName, VarNames
SetSetFuncCalls : SetFuncCall {[SetFuncCall]}
| SetFuncCall; SetFuncCalls {SetFuncCall:SetFuncCalls}
SetFuncCall : filter '['SetName']' (Func)
Func : \'('VarNames')' -> Expr
\(r) -> r[1] == "hello"
Expr : Expr == Expr
| Expr'['Nat']'
| String
| VarName
| Record
| true
| false
Record : '['Exprs']'
Exprs : Expr
| Expr','Exprs
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