forked from jasder/antlr
formatting
This commit is contained in:
parent
e73f72be73
commit
3451dccd6c
|
@ -7,6 +7,7 @@ const RuleContext = require('./RuleContext');
|
|||
const {Hash, Map, equalArrays} = require('./Utils');
|
||||
|
||||
class PredictionContext {
|
||||
|
||||
constructor(cachedHashCode) {
|
||||
this.cachedHashCode = cachedHashCode;
|
||||
}
|
||||
|
@ -83,6 +84,7 @@ function calculateHashString(parent, returnState) {
|
|||
* can be used for both lexers and parsers.
|
||||
*/
|
||||
class PredictionContextCache {
|
||||
|
||||
constructor() {
|
||||
this.cache = new Map();
|
||||
}
|
||||
|
@ -115,6 +117,7 @@ class PredictionContextCache {
|
|||
|
||||
|
||||
class SingletonPredictionContext extends PredictionContext {
|
||||
|
||||
constructor(parent, returnState) {
|
||||
let hashCode = 0;
|
||||
const hash = new Hash();
|
||||
|
@ -182,6 +185,7 @@ class SingletonPredictionContext extends PredictionContext {
|
|||
}
|
||||
|
||||
class EmptyPredictionContext extends SingletonPredictionContext {
|
||||
|
||||
constructor() {
|
||||
super(null, PredictionContext.EMPTY_RETURN_STATE);
|
||||
}
|
||||
|
@ -211,6 +215,7 @@ class EmptyPredictionContext extends SingletonPredictionContext {
|
|||
PredictionContext.EMPTY = new EmptyPredictionContext();
|
||||
|
||||
class ArrayPredictionContext extends PredictionContext {
|
||||
|
||||
constructor(parents, returnStates) {
|
||||
/**
|
||||
* Parent can be null only if full ctx mode and we make an array
|
||||
|
|
|
@ -8,8 +8,8 @@ const {IntervalSet} = require('./../IntervalSet');
|
|||
const {Token} = require('./../Token');
|
||||
|
||||
class ATN {
|
||||
constructor(grammarType , maxTokenType) {
|
||||
|
||||
constructor(grammarType , maxTokenType) {
|
||||
/**
|
||||
* Used for runtime deserialization of ATNs from strings
|
||||
* The type of the ATN.
|
||||
|
|
Loading…
Reference in New Issue