Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error recovery #2038

Draft
wants to merge 215 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
215 commits
Select commit Hold shift + click to select a range
9deefa3
recovered Recoverer from git history
jurgenvinju Mar 30, 2022
d1fdf89
Merge branch 'main' into revive-robust-parsing
jurgenvinju Mar 30, 2022
9ae895c
fixed imports and whitespace
jurgenvinju Mar 31, 2022
4e43070
added documentation
jurgenvinju Mar 31, 2022
ff99ac9
renamed recoverer and simplified to whitespace only and all context-f…
jurgenvinju Mar 31, 2022
d2a0b66
removed unused javadoc plugin that produced warnings
jurgenvinju Mar 31, 2022
d9439a4
fixed compiler warnings
jurgenvinju Mar 31, 2022
d87b4b8
fixed warnings
jurgenvinju Mar 31, 2022
4897d88
fixed warnings
jurgenvinju Mar 31, 2022
5803411
added boolean parameter \'robust\' to parsing API
jurgenvinju Mar 31, 2022
3adee6c
wired boolean parameter for robustness from Rascal function down to p…
jurgenvinju Mar 31, 2022
7318e8f
added override
jurgenvinju Mar 31, 2022
f6e13d8
minor additions to make recovery work and removed dead code
jurgenvinju Apr 11, 2022
ba0fb43
recovered a missing piece from the recovery code
jurgenvinju Apr 13, 2022
650224a
Debugging error recovery
jurgenvinju Apr 14, 2022
6d5d49b
added possibility for recovered nodes to start back in time (at earli…
jurgenvinju Apr 15, 2022
78ee76b
fixed off-by-one: error nodes should be scheduled one character ahead…
jurgenvinju Apr 15, 2022
d9f8fc9
fixed another off-by-one
jurgenvinju Apr 15, 2022
685198d
added initial construction of skipped nodes
jurgenvinju Apr 15, 2022
1d5435b
gave skipped productions a type such that all trees have a type
jurgenvinju Apr 15, 2022
50edd09
Merge branch 'main' into revive-robust-parsing
jurgenvinju Apr 19, 2022
5265ef0
updated template
jurgenvinju Apr 20, 2022
a2162c9
bumped rascal-maven-plugin to 0.8.0 to see if we can benefit from opt…
jurgenvinju Apr 20, 2022
91fb32b
upgraded to rascal-maven-plugin 0.8.1
jurgenvinju Apr 21, 2022
018826f
[maven-release-plugin] prepare release v0.23.1
jurgenvinju Apr 21, 2022
7b6e8b8
[maven-release-plugin] prepare for next development iteration
jurgenvinju Apr 21, 2022
4aefd52
make sure that (a) BasicIDEServices are registered for the commandlin…
jurgenvinju Apr 22, 2022
dde9bd9
basic IDE services can now also browse contents of files which are no…
jurgenvinju Apr 25, 2022
6f9b2b9
Merge branch 'main' into robust-parsing-merge-main
PieterOlivier Jun 6, 2024
d88ac77
Merge branch 'main' into revive-robust-parsing
PieterOlivier Jun 9, 2024
517df9c
Started working on a simple recovery test
PieterOlivier Jun 10, 2024
c779820
Added 'toString' methods and fixed issue in recoverer.
PieterOlivier Jun 17, 2024
13ffcef
Added 'allowRecovery` keyword parameter in parsing functions.
PieterOlivier Jun 18, 2024
b8eb72e
Removed 'Reflective' prefix from StackNodeIdDispenser class name
PieterOlivier Jun 18, 2024
f82006c
WIP: recovery starting to work
PieterOlivier Jun 27, 2024
c8faf66
Merge branch 'main' into robust-parsing/simple-test
PieterOlivier Jul 8, 2024
88cddc3
Added some methods to analyze recovered parse errors in parse trees
PieterOlivier Jul 10, 2024
6d19281
Added comment and removed unused import
PieterOlivier Jul 10, 2024
bcd5914
Enabled logging when error recovery is in effect
PieterOlivier Jul 10, 2024
fb6ffe5
Made printing of productions more robust (it crashed on 'regular' pro…
PieterOlivier Jul 10, 2024
27f1afc
Added some basic recovery tests
PieterOlivier Jul 10, 2024
15fedbf
Implemented parser datastructure visualization using graphviz
PieterOlivier Jul 18, 2024
0eed9a1
Implemented skipping of remaining characters when top-level productio…
PieterOlivier Jul 18, 2024
2b044fd
Reinstated end-of-input check before recovering (for now)
PieterOlivier Jul 18, 2024
d5dbe8c
Minor comment and test changes
PieterOlivier Aug 6, 2024
2246e06
In addition to using whitespace we now also skip until after the last…
PieterOlivier Aug 8, 2024
4b11450
Implemented dynamic last/follow calculations
PieterOlivier Aug 19, 2024
8ef03b4
Minor cleanup of parser tests and debug support
PieterOlivier Aug 20, 2024
7d82f20
Implemented error tree fixup (including source locations)
PieterOlivier Aug 21, 2024
706662b
Renamed RecoveryNodeFlattener to SkippedNodeFlattener
PieterOlivier Aug 21, 2024
7d68129
Implemented basic error disambiguation
PieterOlivier Aug 22, 2024
6b2939c
Added support for error and skipped productions in vis::Text
PieterOlivier Aug 22, 2024
ff350ca
Look "through" non-terminals when finding end/next matchers
PieterOlivier Aug 26, 2024
6d3d58d
Merge branch 'main' into to-token-recoverer
PieterOlivier Aug 26, 2024
d765aaa
Miscellaneous cleanup of error recovery code
PieterOlivier Aug 28, 2024
a4c4494
Removed unused fields from SkippedNode
PieterOlivier Aug 28, 2024
34dccde
Switched from hardcoding to environment variable for the parser visua…
PieterOlivier Aug 28, 2024
7eceab2
Fixed some compiler warnings in the DebugVisualizer
PieterOlivier Aug 28, 2024
8e8f4cb
Fixed some compiler warnings
PieterOlivier Aug 28, 2024
70d04cc
INtroduced StackNodeVisitor
PieterOlivier Aug 28, 2024
defa9ae
Fixed more warnings
PieterOlivier Aug 28, 2024
a8194e6
Madde AbstractStackNode.visit public
PieterOlivier Aug 28, 2024
6feaf4d
Use visitor pattern instead of instanceof in ToTokenRecoverer
PieterOlivier Aug 28, 2024
b95e14e
Renamed DebugVisualizer to ParseStateVisualizer
PieterOlivier Aug 28, 2024
f185e70
Generalized AbstractStackNode visitor to be able to return values
PieterOlivier Aug 28, 2024
4c9664f
Removed debug print
PieterOlivier Aug 28, 2024
154a0b8
Added license header to files introduced for error recovery
PieterOlivier Aug 28, 2024
6e19cd9
Added license header to more files and fixed years.
PieterOlivier Aug 28, 2024
ada22e9
Fixed bug when inputURI is missing
PieterOlivier Aug 28, 2024
b4ac5ee
Fixed issues when location information is missing
PieterOlivier Aug 29, 2024
2a9734d
Fixed off-by-one-error
PieterOlivier Aug 29, 2024
72324dc
Now looking deep to find error trees in getBestErrorTree
PieterOlivier Sep 1, 2024
8a6c089
Removed prints
PieterOlivier Sep 1, 2024
fe4a633
Added 'recovery' tests and introduced artificial failure to see if te…
PieterOlivier Sep 1, 2024
b5c1355
Added recovery tests
PieterOlivier Sep 1, 2024
80307f2
Worked on error recovery tests
PieterOlivier Sep 1, 2024
2fcbf59
Improved comments
PieterOlivier Sep 2, 2024
cacf744
Renamed 'input' field to 'inputUri'.
PieterOlivier Sep 2, 2024
4962772
Removed some obsolete comments
PieterOlivier Sep 2, 2024
1c3f65d
Added backwards compatible 'parser' function
PieterOlivier Sep 4, 2024
6ce5f1c
Renamed input to inputUri
PieterOlivier Sep 4, 2024
346f1d9
Disabled tutor because it requires forward-compatibility of Java code…
PieterOlivier Sep 4, 2024
3675201
Various changes based on an excellent code review by Sung.
PieterOlivier Sep 6, 2024
dbc7fb5
Layout changes
PieterOlivier Sep 6, 2024
b11ea45
Moved tests, replaced UnicodeConverter with String constructor
PieterOlivier Sep 17, 2024
622d406
Control parser visualization by environment variable
PieterOlivier Sep 17, 2024
0679ca7
Introduced NopDebugListener so we can remove all the if checks
PieterOlivier Sep 17, 2024
74362f8
Fixed compiler error
PieterOlivier Sep 18, 2024
5e2ac44
Fixed debugListener NPE
PieterOlivier Sep 18, 2024
7131d5f
Improved parser datastructure visualization
PieterOlivier Sep 18, 2024
4fc8dd1
Look through "nullable" productions
PieterOlivier Sep 23, 2024
b415e7a
Merge pull request #2020 from usethesource/to-token-recoverer
PieterOlivier Sep 23, 2024
fc076d3
Started working on decent test support
PieterOlivier Sep 24, 2024
9d1b403
No longer visualize parser state by default (for instance in CI)
PieterOlivier Sep 24, 2024
a98a96b
Merge branch 'main' into error-recovery
PieterOlivier Sep 24, 2024
61ab83b
Merge branch 'error-recovery' into recovery/testing
PieterOlivier Sep 24, 2024
de0bfca
Added Java and C recovery tests
PieterOlivier Sep 24, 2024
1397669
Removed obsolete tests, replaced by tests in LanguageRecoveryTests.rsc
PieterOlivier Sep 25, 2024
c48a010
Added "delete until end of line" test
PieterOlivier Sep 25, 2024
4b763e9
Improved performance of `findBestError`, improved statistics reporting
PieterOlivier Sep 26, 2024
2a53c90
Added some more languages to test and the output of a baseline run
PieterOlivier Sep 26, 2024
e9b1c5e
Reintroduced 'private'
PieterOlivier Sep 26, 2024
2a47f44
Added removed compass direction
PieterOlivier Sep 27, 2024
191b9c5
Added Rascal batch testing support
PieterOlivier Sep 27, 2024
2c4cfdf
Fixed problem where allocated array was too small
PieterOlivier Sep 27, 2024
2c8cccf
Merge branch 'error-recovery' into recovery/testing
PieterOlivier Sep 27, 2024
495fcdc
Fixed issue with infinite recursion during parsing
PieterOlivier Sep 28, 2024
2abd6b5
Disabled test that are not working yet
PieterOlivier Sep 28, 2024
3177361
Merge branch 'error-recovery' into recovery/testing
PieterOlivier Sep 28, 2024
cd6528d
Check on length as actual error can fluctuate
PieterOlivier Sep 29, 2024
f818086
Improved benchmarking, both in speed and stat quality
PieterOlivier Sep 30, 2024
c2b97a9
Fixed cumulative stats display
PieterOlivier Sep 30, 2024
9cb9e17
Fixed division-by-zero when reference parse time happens to be 0
PieterOlivier Sep 30, 2024
52ea339
Added bug tests and some support for selective testing
PieterOlivier Oct 2, 2024
03a4620
Removed unnecessary changes
PieterOlivier Oct 2, 2024
31080c5
Removed unnecessary changes
PieterOlivier Oct 2, 2024
54e4e0f
Printing a newline after each line of input that is processed
PieterOlivier Oct 2, 2024
c2b7d68
Fixed off-by-one error in newline printing
PieterOlivier Oct 2, 2024
76311db
Merge pull request #2034 from usethesource/recovery/testing
PieterOlivier Oct 2, 2024
4144103
Reimplemented error tree disambiguation in Java
PieterOlivier Oct 2, 2024
6e1b128
Removed references to obsolete 'defaultErrorDisambiguationFilter'
PieterOlivier Oct 2, 2024
f7641ec
Added support for "automatic" disambiguation of error trees
PieterOlivier Oct 2, 2024
92a0570
Error disambiguation can actually return a tree without errors.
PieterOlivier Oct 3, 2024
0aa104b
Moved disambiguator to a better location (and fixed a bug)
PieterOlivier Oct 3, 2024
f70dc3b
Optimized fixErrorAppl
PieterOlivier Oct 3, 2024
323c330
Cleaned up code by using TreeAdapter
PieterOlivier Oct 3, 2024
826eb29
Added check before error node post-processing
PieterOlivier Oct 3, 2024
1f1c70a
Merge pull request #2036 from usethesource/recovery/optimize-fix-errors
PieterOlivier Oct 3, 2024
790a590
Merge branch 'error-recovery' into error-disambiguation-in-java
PieterOlivier Oct 3, 2024
c78ad6f
Fixed imports after moving a class
PieterOlivier Oct 3, 2024
c562109
Merge branch 'main' into error-recovery
PieterOlivier Oct 3, 2024
d548012
Merge branch 'error-recovery' into error-disambiguation-in-java
PieterOlivier Oct 3, 2024
bd25ac7
Fixed recovery checking
PieterOlivier Oct 3, 2024
c7c2e99
Merge branch 'error-recovery' into error-disambiguation-in-java
PieterOlivier Oct 3, 2024
bfbf752
Fixed bug in disambiguator (insert is not the same as append!)
PieterOlivier Oct 3, 2024
b62fec8
Fixed array index out of bounds issue
PieterOlivier Oct 4, 2024
3c96712
Removed 'synchronized'
PieterOlivier Oct 4, 2024
1796da6
Fixed end-of-line sequence to the source end-of-lines
PieterOlivier Oct 4, 2024
c039de5
Merge branch 'main' into feat/error-recovery
PieterOlivier Oct 4, 2024
fac588f
Merge branch 'feat/error-recovery' into error-disambiguation-in-java
PieterOlivier Oct 4, 2024
477552f
Implemented preservation of sharing
PieterOlivier Oct 7, 2024
9827f5a
Slight optimization in ParseErrorDisambiguator
PieterOlivier Oct 7, 2024
b0e4514
Merge pull request #2035 from usethesource/error-disambiguation-in-java
PieterOlivier Oct 8, 2024
cec954c
Moved error recovery functions from ParseTree to util::ErrorRecovery
PieterOlivier Oct 8, 2024
340fc0f
Fixed parse time measurement bug
PieterOlivier Oct 8, 2024
b5561a7
Merge pull request #2042 from usethesource/recovery/recovery-func-to-…
PieterOlivier Oct 8, 2024
ad2988f
Reimplemented `findAllErrors` function in Java because we need it in …
PieterOlivier Oct 8, 2024
740bbe2
Update src/org/rascalmpl/library/util/ErrorRecovery.java
PieterOlivier Oct 8, 2024
399eaf1
Slight optimization
PieterOlivier Oct 8, 2024
e28ea9a
Merge pull request #2043 from usethesource/recovery/find-all-errors-j…
PieterOlivier Oct 8, 2024
9ef4026
Refactored test support
PieterOlivier Oct 12, 2024
e1547f5
Added support for retrieving all errors instead of just one
PieterOlivier Oct 12, 2024
31e5407
Added visualization of AbstractNodes
PieterOlivier Oct 12, 2024
adf6704
Implemented recovery when the input is a valid prefix (or is so after…
PieterOlivier Oct 12, 2024
aa95103
Added a file used to profile error disambiguation
PieterOlivier Oct 12, 2024
e58aefc
Refactored tests, added stats, and removed obsolete function
PieterOlivier Oct 14, 2024
46b707a
Replaced findBestError with findBestErrors
PieterOlivier Oct 14, 2024
40fabd6
Removed unused test files
PieterOlivier Oct 14, 2024
2921bdc
Update src/org/rascalmpl/library/lang/rascal/tests/concrete/recovery/…
PieterOlivier Oct 15, 2024
3d8c2ca
Update src/org/rascalmpl/library/lang/rascal/tests/concrete/recovery/…
PieterOlivier Oct 15, 2024
06eb325
Merge pull request #2053 from usethesource/recovery/multi-errors
PieterOlivier Oct 15, 2024
6528e77
Merge branch 'main' into recovery/no-ws-with-timestamps
PieterOlivier Oct 22, 2024
2683d8c
Removed obsolete keyword parameter
PieterOlivier Oct 22, 2024
1616898
Started working on multi-error support
PieterOlivier Oct 18, 2024
93c1277
Fixed formatting of main parse function
PieterOlivier Oct 18, 2024
9df7f4a
Trigger error recovery when only recovery stacks are left
PieterOlivier Oct 19, 2024
0637b14
Ignoring generated file
PieterOlivier Oct 19, 2024
1700d1b
Filter skipped nodes that skip the same chars and have the same resul…
PieterOlivier Oct 21, 2024
af5ab3a
Fixed tests that failed because error recovery has been improved
PieterOlivier Oct 21, 2024
5c7398f
Simplified MultiErrorPico test
PieterOlivier Oct 22, 2024
e764a94
Merge branch 'recovery/only-recovery-stacks-left' into recovery/no-ws…
PieterOlivier Oct 22, 2024
fa0ed1d
Fixed indentation
PieterOlivier Oct 22, 2024
90c3f23
Added comment on the use of "max match length"
PieterOlivier Oct 23, 2024
b1622c0
Consolidated multi-error issue encountered in Rascal.
PieterOlivier Oct 23, 2024
68c7538
Fixed limit calculation in CaseInsenstiveLiteralMatcher
PieterOlivier Oct 23, 2024
4d94b28
Removed obsolete comment
PieterOlivier Oct 23, 2024
c75cba6
Merge pull request #2057 from usethesource/recovery/only-recovery-sta…
PieterOlivier Oct 24, 2024
803724c
Fixed whitespace issues
PieterOlivier Oct 24, 2024
eadc959
Fixed size inconsistency between allocating and enlarging
PieterOlivier Oct 24, 2024
1633109
Merge pull request #2062 from usethesource/recovery/prop-prefix-bug
PieterOlivier Oct 24, 2024
e123bdc
Fixed regression.
PieterOlivier Oct 25, 2024
32db7de
Added `hasErrors` method
PieterOlivier Oct 25, 2024
e1c2f56
Removed whitespace
PieterOlivier Oct 25, 2024
93b4205
Layout fixes
PieterOlivier Oct 29, 2024
ff5f36d
Added '\n' end matcher so end-of-line is also seen as skip terminator
PieterOlivier Oct 29, 2024
377cb8c
Fixed Pico test
PieterOlivier Oct 29, 2024
79267ce
Merge pull request #2064 from usethesource/recovery/end-of-line-token
PieterOlivier Oct 31, 2024
54a9c53
Removed whitespace
PieterOlivier Oct 31, 2024
8d35fc9
Showing mean with two digit precision
PieterOlivier Nov 3, 2024
37ce549
Single whitespace change
PieterOlivier Nov 3, 2024
415773f
Merge branch 'main' into feat/error-recovery
PieterOlivier Nov 5, 2024
79be4a0
Merge branch 'main' into feat/error-recovery
PieterOlivier Nov 8, 2024
e1a9cd9
Removed automatic error disambiguation when allowRecovery=true and al…
PieterOlivier Nov 11, 2024
ae9aa76
Added check for 'regular' ambiguities when allowAmbiguities=false but…
PieterOlivier Nov 11, 2024
40b1226
No longer building the result tree when just checking for regular amb…
PieterOlivier Nov 11, 2024
e523ce2
Renamed 'symbol' field in skipped production to 'def'
PieterOlivier Nov 13, 2024
c861e93
Merge pull request #2078 from usethesource/recovery/symbol-to-def
PieterOlivier Nov 13, 2024
e8bed22
Added timing ratio column and replaced ',' with ':' in end-of-line uri
PieterOlivier Nov 16, 2024
ea5658f
Improved recovery stats gathering and added R script to process the s…
PieterOlivier Nov 18, 2024
2ce0092
Fixed the case where one of the alternative of an ambiguity is an emp…
PieterOlivier Nov 19, 2024
e848bb5
Fixed use of '|unknown:///|' as stats location
PieterOlivier Nov 22, 2024
0bcc2b7
Merge branch 'main' into feat/error-recovery
PieterOlivier Dec 9, 2024
c460e2c
Merge pull request #2075 from usethesource/feat/remove-auto-disambigu…
PieterOlivier Dec 17, 2024
8c405fc
Merge branch 'feat/error-recovery' into recovery/empty-error-disambig…
PieterOlivier Dec 17, 2024
1aee3c4
Merge pull request #2084 from usethesource/recovery/empty-error-disam…
PieterOlivier Dec 17, 2024
cdeb4bc
Improved error recovery documentation
PieterOlivier Dec 21, 2024
e552ee6
Improved error recovery documentation
PieterOlivier Dec 21, 2024
315b072
Removed obsolete trace from NOTES.md and added explanation on stats file
PieterOlivier Dec 21, 2024
0ec1617
Removed unnecessary addition to .gitignore
PieterOlivier Dec 21, 2024
213c897
Added license header
PieterOlivier Dec 21, 2024
49308de
Added license header
PieterOlivier Dec 21, 2024
4fabc73
Undid license header addition: does not belong in this branch/PR
PieterOlivier Dec 21, 2024
29387f9
Fixed indentation
PieterOlivier Dec 21, 2024
a34998d
Removed my initials from comment
PieterOlivier Dec 21, 2024
d93b87c
Minor changes (mainly layout)
PieterOlivier Dec 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added some more languages to test and the output of a baseline run
  • Loading branch information
PieterOlivier authored and toinehartman committed Sep 26, 2024
commit 2a53c907a47939329f4c7848673e28cf991be55c
2 changes: 2 additions & 0 deletions src/org/rascalmpl/library/lang/diff/unified/UnifiedDiff.rsc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
@contributor{Tijs van der Storm - storm@cwi.nl (CWI)}
module lang::diff::unified::UnifiedDiff

start syntax DiffFile = Diff;

syntax Diff
= Header old Header new Chunk* chunks
;
Expand Down
39 changes: 39 additions & 0 deletions src/org/rascalmpl/library/lang/diff/unified/examples/example.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
--- a/src/org/rascalmpl/parser/uptr/UPTRNodeFactory.java
+++ b/src/org/rascalmpl/parser/uptr/UPTRNodeFactory.java
@@ -1,6 +1,7 @@
package org.rascalmpl.parser.uptr;

import java.net.URI;
+import java.util.Arrays;
import java.util.IdentityHashMap;
import java.util.Map;

@@ -21,7 +22,9 @@ import org.rascalmpl.values.parsetrees.ProductionAdapter;
import org.rascalmpl.values.parsetrees.TreeAdapter;

public class UPTRNodeFactory implements INodeConstructorFactory<ITree, ISourceLocation>{
- private final static RascalValueFactory VF = (RascalValueFactory) ValueFactoryFactory.getValueFactory();
+ private static final RascalValueFactory VF = (RascalValueFactory) ValueFactoryFactory.getValueFactory();
+ private static final IConstructor SKIPPED = VF.constructor(RascalValueFactory.Production_Skipped, VF.constructor(RascalValueFactory.Symbol_IterStar, VF.constructor(RascalValueFactory.Symbol_CharClass, VF.list(VF.constructor(RascalValueFactory.CharRange_Range, VF.integer(1), VF.integer(Character.MAX_CODE_POINT))))));
+
private boolean allowAmb;

public UPTRNodeFactory(boolean allowAmbiguity){
@@ -141,7 +144,14 @@ public class UPTRNodeFactory implements INodeConstructorFactory<ITree, ISourceLo
}

@Override
- public ITree createRecoveryNode(int[] characters) {
- throw new UnsupportedOperationException();
- }
+ public ITree createSkippedNode(int[] characters) {
+ return createLiteralNode(characters, SKIPPED);
+ }
+
+ public ITree createErrorNode(ArrayList<ITree> children, Object production) {
+ IConstructor prod = (IConstructor) production;
+ IConstructor errorProd = VF.constructor(RascalValueFactory.Production_Error, prod.get(0), prod, VF.integer(children.size()-1));
+ return buildAppl(children, errorProd);
+ }
+
}
46 changes: 46 additions & 0 deletions src/org/rascalmpl/library/lang/dot/examples/parse-state.dot
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
digraph Parser {
"Parser"["label"="Parser\nInput: \"void f(){if(1){}}\"\nLocation: 0 ('v')\nStep 2: Reducing terminals"];
"todo-1"["label"="<0> 0", "shape"="record"];
"-2"["label"="Epsilon: \n.0@0 ,matchable,end\n?\nin: 'sort(\"Tag\") -> regular(\iter-star-seps(sort(\"Tag\"),[layouts(\"LAYOUTLIST\")]))'"];
"124"["label"="SeparatedList: 124\n.0@0 ,expandable,end\n124\nin: 'default -> tags'"];
"12858"["label"="NonTerminal: Tags\n.0@0 \nTags\nin: Tags Visibility Signature '=' Expression 'when' 12878 ';'"];
"-1"["label"="NonTerminal: FunctionDeclaration\n.0@-1 \nFunctionDeclaration"];
"12858" -> "-1";
"124" -> "12858";
"-2" -> "124";
"todo-1":"0":sw -> "-2"["label"="Stack"];
"46484886"["shape"="octagon", "label"="Epsilon"];
"todo-1":"0":se -> "46484886"["label"="Node"];
"todoLists":"1" -> "todo-1";
"todoLists"["label"="<0> 0 | <1> 1 | <2> 2 | <3> 3 | <4> 4 | <5> 5 | <6> 6 | <7> 7 | <8> 8 | <9> 9 | <10> 10 | <11> 11 | <12> 12 | <13> 13 | <14> 14 | <15> 15", "shape"="record"];
"Parser" -> "todoLists"["label"="todo lists"];
"stacksToExpand"["label"="", "shape"="record"];
"Parser" -> "stacksToExpand"["label"="stacks to expand"];
"terminalsToReduce"["label"="<0> 0", "shape"="record", "color"="red"];
"terminalsToReduce":"0":sw -> "-2"["label"="Stack"];
"terminalsToReduce":"0":se -> "46484886"["label"="Node"];
"Parser" -> "terminalsToReduce"["label"="terminals to reduce"];
"nonTerminalsToReduce"["label"="", "shape"="record"];
"Parser" -> "nonTerminalsToReduce"["label"="non-terminals to reduce"];
"122"["label"="NonTerminal: Tag\n.0@0 ,end\nTag\nin: 'sort(\"Tag\") -> regular(\iter-star-seps(sort(\"Tag\"),[layouts(\"LAYOUTLIST\")]))'"];
"122" -> "124";
"unexpandableNodes":"0" -> "122";
"unexpandableNodes"["label"="<0> 0", "shape"="record"];
"12824"["label"="Char: \n.0@-1 ,matchable\n0\nin: 0 'sort(\"FunctionDeclaration\")' ':' 12828 0"];
"unmatchableLeafNodes":"0" -> "12824";
"128"["label"="Char: \n.0@-1 ,matchable\n0\nin: 0 'sort(\"Tags\")' ':' 132 0"];
"unmatchableLeafNodes":"1" -> "128";
"2043"["label"="Literal: \n.0@-1 ,matchable\n'@'\nin: '@' Name '=' Expression"];
"unmatchableLeafNodes":"2" -> "2043";
"2065"["label"="Char: \n.0@-1 ,matchable\n0\nin: 0 '\iter-star(sort(\"Tag\"))' ':' 2069 0"];
"unmatchableLeafNodes":"3" -> "2065";
"unmatchableLeafNodes"["label"="<0> 0 | <1> 1 | <2> 2 | <3> 3", "shape"="record"];
"unmatchableMidProductionNodes"["shape"="record", "label"=""];
"filteredNodes"["label"="", "shape"="record"];
"error"["label"="Errors"];
"Parser" -> "error"["label"="error tracking"];
"error" -> "unexpandableNodes"["label"="unexpandable"];
"error" -> "unmatchableLeafNodes"["label"="unmatchable leafs"];
"error" -> "unmatchableMidProductionNodes"["label"="unmatchable mid-prod"];
"error" -> "filteredNodes"["label"="filtered"];
}
65 changes: 65 additions & 0 deletions src/org/rascalmpl/library/lang/dot/examples/parser-state.dot
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
digraph Parser {
"Parser"["label"="Parser\nInput: \"void f(){if(1){}}\"\nLocation: 0 ('v')\nStep 5: Reducing terminals"];
"todo-1"["label"="<0> 0", "shape"="record"];
"-2"["label"="Epsilon: \n.0@0 ,matchable,end\n?\nin: 'lex(\"LAYOUT\") -> regular(\iter-star(lex(\"LAYOUT\")))'"];
"7226"["label"="List: 7226\n.0@0 ,expandable,end\n7226\nin: 'LAYOUTLIST -> \iter-star(lex(\"LAYOUT\"))'"];
"12860"["label"="NonTerminal: LAYOUTLIST\n.1@0 \nlayouts_LAYOUTLIST\nin: Tags Visibility Signature '=' Expression 'when' 12878 ';'"];
"-1"["label"="NonTerminal: FunctionDeclaration\n.0@-1 \nFunctionDeclaration"];
"12860" -> "-1";
"7226" -> "12860";
"-2" -> "7226";
"todo-1":"0" -> "-2"["label"="Stack"];
"46484886"["shape"="octagon", "label"="Epsilon"];
"todo-1":"0":se -> "46484886"["label"="Node"];
"todoLists":"1" -> "todo-1";
"todoLists"["label"="<0> 0 | <1> 1 | <2> 2 | <3> 3 | <4> 4 | <5> 5 | <6> 6 | <7> 7 | <8> 8 | <9> 9 | <10> 10 | <11> 11 | <12> 12 | <13> 13 | <14> 14 | <15> 15", "shape"="record"];
"Parser" -> "todoLists"["label"="todo lists"];
"stacksToExpand"["label"="", "shape"="record"];
"Parser" -> "stacksToExpand"["label"="stacks to expand"];
"terminalsToReduce"["label"="<0> 0", "shape"="record", "color"="red"];
"terminalsToReduce":"0":sw -> "-2"["label"="Stack"];
"terminalsToReduce":"0":se -> "46484886"["label"="Node"];
"Parser" -> "terminalsToReduce"["label"="terminals to reduce"];
"nonTerminalsToReduce"["label"="", "shape"="record"];
"Parser" -> "nonTerminalsToReduce"["label"="non-terminals to reduce"];
"122"["label"="NonTerminal: Tag\n.0@0 ,end\nTag\nin: 'sort(\"Tag\") -> regular(\iter-star-seps(sort(\"Tag\"),[layouts(\"LAYOUTLIST\")]))'"];
"124"["label"="SeparatedList: 124\n.0@0 ,expandable,end\n124\nin: 'default -> tags'"];
"12858"["label"="NonTerminal: Tags\n.0@0 \nTags\nin: Tags Visibility Signature '=' Expression 'when' 12878 ';'"];
"12858" -> "-1";
"124" -> "12858";
"122" -> "124";
"unexpandableNodes":"0" -> "122";
"13120"["label"="NonTerminal: Comment\n.0@0 ,end\nComment\nin: 'LAYOUT -> Comment'"];
"7221"["label"="NonTerminal: LAYOUT\n.0@0 ,end\nLAYOUT\nin: 'lex(\"LAYOUT\") -> regular(\iter-star(lex(\"LAYOUT\")))'"];
"7221" -> "7226";
"13120" -> "7221";
"unexpandableNodes":"1" -> "13120";
"unexpandableNodes"["label"="<0> 0 | <1> 1", "shape"="record"];
"12824"["label"="Char: \n.0@-1 ,matchable\n0\nin: 0 'sort(\"FunctionDeclaration\")' ':' 12828 0"];
"unmatchableLeafNodes":"0" -> "12824";
"128"["label"="Char: \n.0@-1 ,matchable\n0\nin: 0 'sort(\"Tags\")' ':' 132 0"];
"unmatchableLeafNodes":"1" -> "128";
"2043"["label"="Literal: \n.0@-1 ,matchable\n'@'\nin: '@' Name '=' Expression"];
"unmatchableLeafNodes":"2" -> "2043";
"2065"["label"="Char: \n.0@-1 ,matchable\n0\nin: 0 '\iter-star(sort(\"Tag\"))' ':' 2069 0"];
"unmatchableLeafNodes":"3" -> "2065";
"13122"["label"="Char: \n.0@-1 ,matchable,end\n9-13,32,133,160,5760,6158,8192-8202,8232-8233,8239,8287,12288\nin: 'LAYOUT -> [range(9,13),range(32,32),range(133,133),range(160,160),range(5760,5760),range(6158,6158),range(8192,8202),range(8232,8233),range(8239,8239),range(8287,8287),range(12288,12288)]'"];
"unmatchableLeafNodes":"4" -> "13122";
"13125"["label"="Char: \n.0@-1 ,matchable\n0\nin: 0 '\iter-star(sort(\"LAYOUT\"))' ':' 13129 0"];
"unmatchableLeafNodes":"5" -> "13125";
"7373"["label"="Literal: \n.0@-1 ,matchable\n'/*'\nin: '/*' 7379 '*/'"];
"unmatchableLeafNodes":"6" -> "7373";
"7382"["label"="Literal: \n.0@-1 ,matchable\n'//'\nin: '//' 7386"];
"unmatchableLeafNodes":"7" -> "7382";
"7389"["label"="Char: \n.0@-1 ,matchable\n0\nin: 0 'sort(\"Comment\")' ':' 7393 0"];
"unmatchableLeafNodes":"8" -> "7389";
"unmatchableLeafNodes"["label"="<0> 0 | <1> 1 | <2> 2 | <3> 3 | <4> 4 | <5> 5 | <6> 6 | <7> 7 | <8> 8", "shape"="record"];
"unmatchableMidProductionNodes"["shape"="record", "label"=""];
"filteredNodes"["label"="", "shape"="record"];
"error"["label"="Errors"];
"Parser" -> "error"["label"="error tracking"];
"error" -> "unexpandableNodes"["label"="unexpandable"];
"error" -> "unmatchableLeafNodes"["label"="unmatchable leafs"];
"error" -> "unmatchableMidProductionNodes"["label"="unmatchable mid-prod"];
"error" -> "filteredNodes"["label"="filtered"];
}
2 changes: 1 addition & 1 deletion src/org/rascalmpl/library/lang/dot/syntax/Dot.rsc
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ syntax NodeId
| Id Port
;

syntax Port = ":" Id Id?
syntax Port = ":" Id (":" Id)?
// | ":" Id
// | ":" CompassPt
;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
module lang::rascal::tests::concrete::recovery::ErrorRecoveryBenchmark

import lang::rascal::tests::concrete::recovery::RecoveryTestSupport;

void runTestC() { testRecoveryC(); }
void runTestDiff() { testRecoveryDiff(); }
void runTestDot() { testRecoveryDot(); }
void runTestJava() { testRecoveryJava(); }
void runTestJson() { testRecoveryJson(); }
void runTestPico() { testRecoveryPico(); }
void runTestRascal() { testRecoveryRascal(); }

TestStats testRecoveryC() = testErrorRecovery(|std:///lang/c90/syntax/C.rsc|, "TranslationUnit", |std:///lang/c90/examples/hello-world.c|);
TestStats testRecoveryDiff() = testErrorRecovery(|std:///lang/diff/unified/UnifiedDiff.rsc|, "DiffFile", |std:///lang/diff/unified/examples/example.diff|);
TestStats testRecoveryDot() = testErrorRecovery(|std:///lang/dot/syntax/Dot.rsc|, "DOT", |std:///lang/dot/examples/parser-state.dot|);
TestStats testRecoveryJava() = testErrorRecovery(|std:///lang/java/syntax/Java15.rsc|, "CompilationUnit", zippedFile("m3/snakes-and-ladders-project-source.zip", "src/snakes/LastSquare.java"));
TestStats testRecoveryJson() = testErrorRecovery(|std:///lang/json/syntax/JSON.rsc|, "JSONText", |std:///lang/json/examples/ex01.json|);
TestStats testRecoveryPico() = testErrorRecovery(|std:///lang/pico/syntax/Main.rsc|, "Program", |std:///lang/pico/examples/fac.pico|);
TestStats testRecoveryRascal() = testErrorRecovery(|std:///lang/rascal/syntax/Rascal.rsc|, "Module", |std:///lang/rascal/vis/ImportGraph.rsc|);

void runLanguageTests() {
testRecoveryC();
testRecoveryDiff();
testRecoveryDot();
testRecoveryJava();
testRecoveryJson();
testRecoveryPico();
testRecoveryRascal();
}

This file was deleted.

Loading