Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pumcl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
YAPEX
pumcl
Commits
eaa4e62e
Commit
eaa4e62e
authored
7 years ago
by
Janis Daniel Dähne
Browse files
Options
Downloads
Patches
Plain Diff
- added notes support
parent
d0efd576
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
LangDefClassdiagrams.pdf
+0
-0
0 additions, 0 deletions
LangDefClassdiagrams.pdf
compiler/pumcl.jison
+61
-9
61 additions, 9 deletions
compiler/pumcl.jison
tests/syntax001.ts
+18
-16
18 additions, 16 deletions
tests/syntax001.ts
with
79 additions
and
25 deletions
LangDefClassdiagrams.pdf
+
0
−
0
View file @
eaa4e62e
No preview for this file type
This diff is collapsed.
Click to expand it.
compiler/pumcl.jison
+
61
−
9
View file @
eaa4e62e
...
...
@@ -197,6 +197,7 @@ statement
| addToClassStatement
| interfaceDefinitionStatement
| enumDefinitionStatement
| noteDefinitionStatement
;
/* --- relations --- */
...
...
@@ -309,10 +310,17 @@ maybeStereotype
| ANGEL_BRACKET_OPEN ANGEL_BRACKET_OPEN IDENT ANGEL_BRACKET_CLOSE ANGEL_BRACKET_CLOSE
;
nameDefinition
: IDENT
| STRING AS IDENT
| IDENT AS STRING
;
classDefinition
: CLASS_KEYWORD
IDENT
maybeStereotype
| CLASS_KEYWORD
IDENT
maybeStereotype CURL_BRACKET_OPEN NL CURL_BRACKET_CLOSE
| CLASS_KEYWORD
IDENT
maybeStereotype CURL_BRACKET_OPEN NL classMemberList CURL_BRACKET_CLOSE
: CLASS_KEYWORD
nameDefinition
maybeStereotype
| CLASS_KEYWORD
nameDefinition
maybeStereotype CURL_BRACKET_OPEN NL CURL_BRACKET_CLOSE
| CLASS_KEYWORD
nameDefinition
maybeStereotype CURL_BRACKET_OPEN NL classMemberList CURL_BRACKET_CLOSE
;
addToClassStatement
...
...
@@ -345,9 +353,9 @@ interfaceMemberList
;
interfaceDefinitionStatement
: INTERFACE_KEYWORD
IDENT
maybeStereotype
| INTERFACE_KEYWORD
IDENT
maybeStereotype CURL_BRACKET_OPEN NL CURL_BRACKET_CLOSE
| INTERFACE_KEYWORD
IDENT
maybeStereotype CURL_BRACKET_OPEN NL interfaceMemberList CURL_BRACKET_CLOSE
: INTERFACE_KEYWORD
nameDefinition
maybeStereotype
| INTERFACE_KEYWORD
nameDefinition
maybeStereotype CURL_BRACKET_OPEN NL CURL_BRACKET_CLOSE
| INTERFACE_KEYWORD
nameDefinition
maybeStereotype CURL_BRACKET_OPEN NL interfaceMemberList CURL_BRACKET_CLOSE
;
/* --- end interfaces --- */
...
...
@@ -368,14 +376,58 @@ enumMemberList
;
enumDefinitionStatement
: ENUM_KEYWORD
IDENT
maybeStereotype
| ENUM_KEYWORD
IDENT
maybeStereotype CURL_BRACKET_OPEN NL CURL_BRACKET_CLOSE
| ENUM_KEYWORD
IDENT
maybeStereotype CURL_BRACKET_OPEN NL enumMemberList CURL_BRACKET_CLOSE
: ENUM_KEYWORD
nameDefinition
maybeStereotype
| ENUM_KEYWORD
nameDefinition
maybeStereotype CURL_BRACKET_OPEN NL CURL_BRACKET_CLOSE
| ENUM_KEYWORD
nameDefinition
maybeStereotype CURL_BRACKET_OPEN NL enumMemberList CURL_BRACKET_CLOSE
;
/* --- end enums --- */
/* --- notes --- */
noteNameDefinition
: AS IDENT
;
noteKeywordDirectionOf
: NOTE_KEYWORD_LEFT_OF
| NOTE_KEYWORD_RIGHT_OF
| NOTE_KEYWORD_TOP_OF
| NOTE_KEYWORD_BOTTOM_OF
;
noteKeywordDirection
: NOTE_KEYWORD_LEFT
| NOTE_KEYWORD_RIGHT
| NOTE_KEYWORD_TOP
| NOTE_KEYWORD_BOTTOM
;
noteKeywordOnLink
: NOTE_KEYWORD_ON_LINK
| NOTE_KEYWORD_LEFT_ON_LINK
| NOTE_KEYWORD_RIGHT_ON_LINK
| NOTE_KEYWORD_TOP_ON_LINK
| NOTE_KEYWORD_BOTTOM_ON_LINK
;
noteDefinitionStatement
: NOTE_KEYWORD STRING
| NOTE_KEYWORD STRING noteNameDefinition
| noteKeywordDirectionOf IDENT COLON STRING
| noteKeywordDirection COLON STRING
| noteKeywordOnLink COLON STRING
;
/* --- end nodes --- */
/* all lines ... */
someLine
:LINE
...
...
This diff is collapsed.
Click to expand it.
tests/syntax001.ts
+
18
−
16
View file @
eaa4e62e
...
...
@@ -421,20 +421,22 @@ const testsOk3: string[] = [
`note "this is a test" as N1`
,
`class X
note "connected to X"
note "connected to X"
note "
not
connected to X"
note "
note
connected to X"
as Note0
note "connected to X"
note "
note
connected to X"
note top of X : "also connected to X"
note left of X : "also connected to X"
note right of X : "also connected to X"
note bottom of X : "also connected to X"
class Y
note top of X : "connected to X"
note left of X : "connected to X"
note right of X : "connected to X"
note bottom of X : "connected to X"
`
,
`class X
note "connected to X"
note "
not
connected to X"
note top of X : "also connected to X2"
`
,
...
...
@@ -610,11 +612,11 @@ const testsOk4: string[] = [
`interface interface2 as " It works this way too"`
,
`interface " This is my interface" as interface1 << test >> {
void
foo()
foo()
: void
}`
,
`interface interface2 as " It works this way too" << test >> {
void
foo()
foo()
: void
}`
,
`enum " This is my enum" as enum1`
...
...
@@ -1031,17 +1033,17 @@ a--
// displayTestResult(runTest(prog))
// })
// //
testsOk2
.
forEach
(
prog
=>
{
displayTestResult
(
runTest
(
prog
))
})
//
// testsOk3.forEach(prog => {
// testsOk2.forEach(prog => {
// displayTestResult(runTest(prog))
// })
//
testsOk
4
.
forEach
(
prog
=>
{
testsOk
3
.
forEach
(
prog
=>
{
displayTestResult
(
runTest
(
prog
))
})
//
// testsOk4.forEach(prog => {
// displayTestResult(runTest(prog))
// })
// testsOk5.forEach(prog => {
// displayTestResult(runTest(prog))
...
...
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