You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Feature/docclean Greatly improve the godoc comments in the runtime (#4169)
* doc: Updates to some of the Go doc comments to start a ful ldocumentation cleanup
Signed-off-by: Jim.Idle <[email protected]>
* doc: More documentation fixes.
Using this as a method of forcing myself to read every line of code in the runtime, and therefore
discover mistakes in the original implementation. And, of course, actually working docs for the
Go runtime, can only be a good thing.
Signed-off-by: Jim.Idle <[email protected]>
* doc: More documentation fixes
Also changes the exporet level of a some variables and funcs that were not correct,
even though no user has currently needed them it would seem.
Signed-off-by: Jim.Idle <[email protected]>
* doc: Many updates to document exported fuctions correctly and reformat the ingerited Java code
It looks like a massive amount of changes, but it is almost all doc or changing exports or renaming
unused paramters etc to make the Go linter happy.
No actual code changes yet.
Signed-off-by: Jim.Idle <[email protected]>
* doc: More additions and corrections to the Go documentation for the runtime
Signed-off-by: Jim.Idle <[email protected]>
* doc: Final clean of exported func and type documentation
There will be more to do here as there are a lot of things that are hidden internal to the antlr
package that probably should not be. There are also a lot of exported funcs and types without
any documentation, that will eventually need to be cleaned up.
Signed-off-by: Jim.Idle <[email protected]>
* Changed Parser typings (#4149)
Signed-off-by: Josua Frank <[email protected]>
Co-authored-by: Josua Frank <[email protected]>
Signed-off-by: Jim.Idle <[email protected]>
* fix: Fixes the failing go runtime test suite which was missing the /v4 off the replace option on the go.mod file (#4163)
Arrrgh!
Signed-off-by: Jim.Idle <[email protected]>
* present antlr before versioning (#4156)
Signed-off-by: Jim.Idle <[email protected]>
* fix: Prevent use of labels such as start= from generating code that clashes with builtin funcs (#4161)
Signed-off-by: Jim.Idle <[email protected]>
* Feature/gotestfix (#4168)
* fix: Fixes the failing go runtime test suite which was missing the /v4 off the replace option on the go.mod file
Arrrgh!
Signed-off-by: Jim.Idle <[email protected]>
* present antlr before versioning (#4156)
Signed-off-by: Jim.Idle <[email protected]>
* fix: Prevent use of labels such as start= from generating code that clashes with builtin funcs (#4161)
Signed-off-by: Jim.Idle <[email protected]>
* fix: Cater for the fact that some test rules use start as a label or rule name
As a fix for other cvode gen errors when start, end, or exception are used as
label names, they are now translated to have a suffix of `_` at code gen time.
However, the runtime tests sometimes use start as a rule name and so we must now
cater for this in the tests.
Signed-off-by: Jim.Idle <[email protected]>
---------
Signed-off-by: Jim.Idle <[email protected]>
Co-authored-by: ericvergnaud <[email protected]>
Signed-off-by: Jim.Idle <[email protected]>
---------
Signed-off-by: Jim.Idle <[email protected]>
Signed-off-by: Josua Frank <[email protected]>
Co-authored-by: Josua Frank <[email protected]>
Co-authored-by: Josua Frank <[email protected]>
Co-authored-by: ericvergnaud <[email protected]>
Copy file name to clipboardExpand all lines: runtime/Go/antlr/v4/atn_config.go
+44-7Lines changed: 44 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -10,29 +10,44 @@ import (
10
10
11
11
// ATNConfig is a tuple: (ATN state, predicted alt, syntactic, semantic
12
12
// context). The syntactic context is a graph-structured stack node whose
13
-
// path(s) to the root is the rule invocation(s) chain used to arrive at the
13
+
// path(s) to the root is the rule invocation(s) chain used to arrive in the
14
14
// state. The semantic context is the tree of semantic predicates encountered
15
15
// before reaching an ATN state.
16
16
typeATNConfiginterface {
17
+
18
+
// Equals compares this ATNConfig to another for equality
17
19
Equals(oCollectable[ATNConfig]) bool
20
+
21
+
// Hash returns the hash code for this ATNConfig for use in maps and comparisons
18
22
Hash() int
19
23
24
+
// GetState returns the ATN state associated with this configuration
20
25
GetState() ATNState
26
+
// GetAlt returns the alternative associated with this configuration
21
27
GetAlt() int
28
+
// GetSemanticContext returns the semantic context associated with this configuration
22
29
GetSemanticContext() SemanticContext
23
30
31
+
// GetContext returns the rule invocation stack associated with this configuration
24
32
GetContext() PredictionContext
33
+
// SetContext sets the rule invocation stack associated with this configuration
25
34
SetContext(PredictionContext)
26
35
36
+
// GetReachesIntoOuterContext returns the count of references to an outer context from this configuration
27
37
GetReachesIntoOuterContext() int
38
+
// SetReachesIntoOuterContext sets the count of references to an outer context from this configuration
28
39
SetReachesIntoOuterContext(int)
29
40
41
+
// String returns a string representation of the configuration
30
42
String() string
31
43
32
44
getPrecedenceFilterSuppressed() bool
33
45
setPrecedenceFilterSuppressed(bool)
34
46
}
35
47
48
+
// BaseATNConfig is a base implementation of ATNConfig. Thi si s done to emulate Java's ability to have multiple
49
+
// constructors for a single class. This is not idiomatic Go, but it works for now.
50
+
// TODO: this isn't the way to do this I think, but it will take time to rework - JI Also, getters and setters are not Go. Might be better to just access the fields, though the compiler will probably eliminate the calls
0 commit comments