{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./node_modules/antlr4/BufferedTokenStream.js","webpack:///./node_modules/antlr4/CharStreams.js","webpack:///./node_modules/antlr4/CommonTokenFactory.js","webpack:///./node_modules/antlr4/CommonTokenStream.js","webpack:///./node_modules/antlr4/FileStream.js","webpack:///./node_modules/antlr4/InputStream.js","webpack:///./node_modules/antlr4/IntervalSet.js","webpack:///./node_modules/antlr4/LL1Analyzer.js","webpack:///./node_modules/antlr4/Lexer.js","webpack:///./node_modules/antlr4/Parser.js","webpack:///./node_modules/antlr4/ParserRuleContext.js","webpack:///./node_modules/antlr4/PredictionContext.js","webpack:///./node_modules/antlr4/Recognizer.js","webpack:///./node_modules/antlr4/RuleContext.js","webpack:///./node_modules/antlr4/Token.js","webpack:///./node_modules/antlr4/Utils.js","webpack:///./node_modules/antlr4/atn/ATN.js","webpack:///./node_modules/antlr4/atn/ATNConfig.js","webpack:///./node_modules/antlr4/atn/ATNConfigSet.js","webpack:///./node_modules/antlr4/atn/ATNDeserializationOptions.js","webpack:///./node_modules/antlr4/atn/ATNDeserializer.js","webpack:///./node_modules/antlr4/atn/ATNSimulator.js","webpack:///./node_modules/antlr4/atn/ATNState.js","webpack:///./node_modules/antlr4/atn/ATNType.js","webpack:///./node_modules/antlr4/atn/LexerATNSimulator.js","webpack:///./node_modules/antlr4/atn/LexerAction.js","webpack:///./node_modules/antlr4/atn/LexerActionExecutor.js","webpack:///./node_modules/antlr4/atn/ParserATNSimulator.js","webpack:///./node_modules/antlr4/atn/PredictionMode.js","webpack:///./node_modules/antlr4/atn/SemanticContext.js","webpack:///./node_modules/antlr4/atn/Transition.js","webpack:///./node_modules/antlr4/atn/index.js","webpack:///./node_modules/antlr4/dfa/DFA.js","webpack:///./node_modules/antlr4/dfa/DFASerializer.js","webpack:///./node_modules/antlr4/dfa/DFAState.js","webpack:///./node_modules/antlr4/dfa/index.js","webpack:///./node_modules/antlr4/error/DiagnosticErrorListener.js","webpack:///./node_modules/antlr4/error/ErrorListener.js","webpack:///./node_modules/antlr4/error/ErrorStrategy.js","webpack:///./node_modules/antlr4/error/Errors.js","webpack:///./node_modules/antlr4/error/index.js","webpack:///./node_modules/antlr4/index.js","webpack:///./node_modules/antlr4/polyfills/codepointat.js","webpack:///./node_modules/antlr4/polyfills/fromcodepoint.js","webpack:///./node_modules/antlr4/tree/Tree.js","webpack:///./node_modules/antlr4/tree/Trees.js","webpack:///./node_modules/antlr4/tree/index.js","webpack:///./wwwroot/app/Sketch/SketchLexer.js","webpack:///./wwwroot/app/Sketch/SketchListener.js","webpack:///./wwwroot/app/Sketch/SketchParser.js","webpack:///./wwwroot/app/Sketch/app.js"],"names":[],"mappings":";AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kDAA0C,gCAAgC;AAC1E;AACA;;AAEA;AACA;AACA;AACA,gEAAwD,kBAAkB;AAC1E;AACA,yDAAiD,cAAc;AAC/D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAyC,iCAAiC;AAC1E,wHAAgH,mBAAmB,EAAE;AACrI;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;;AAGA;AACA;;;;;;;;;;;;AClFA;AACA;AACA;AACA;AACA;;AAEA,2BAA2B,kBAAkB;AAC7C,IAAI,kBAAkB;AACtB;AACA;AACA;AACA,2CAA2C,wBAAwB;AACnE;AACA,qBAAqB,6BAA6B;AAClD,IAAI,4BAA4B;AAChC,IAAI,wBAAwB;;AAE5B,YAAY,mBAAO,CAAC,+CAAS;AAC7B,YAAY,mBAAO,CAAC,+CAAS;AAC7B,eAAe,mBAAO,CAAC,2DAAe;;AAEtC;AACA;AACA;AACA;;AAEA;;AAEA;AACA,SAAS,kBAAkB;AAC3B;;AAEA;AACA,kDAAkD,mBAAmB;AACrE,QAAQ,WAAW;AACnB;;AAEA,oBAAoB,eAAe;AACnC,KAAK,gBAAgB,IAAI,gBAAgB,SAAS,WAAW,QAAQ;AACrE;AACA,KAAK,iBAAiB;AACtB;AACA;AACA,KAAK,uBAAuB;AAC5B;AACA,8BAA8B,gBAAgB;AAC9C;AACA;;AAEA,2BAA2B,iBAAiB;AAC5C,KAAK,oBAAoB,eAAe,eAAe;AACvD;AACA;AACA;AACA,SAAS,gBAAgB,0BAA0B,gBAAgB;AACnE;AACA;AACA,KAAK,mBAAmB,MAAM,UAAU,qBAAqB;AAC7D,SAAS;AACT,SAAS,cAAc;AACvB;AACA,KAAK,eAAe;AACpB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,oBAAoB,QAAQ;AAC5B;AACA,YAAY,WAAW,iCAAiC,QAAQ;AAChE,IAAI,YAAY;AAChB;AACA;AACA;AACA,oCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA,QAAQ,QAAQ;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,UAAU;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,yDAAyD,QAAQ;AACjE;AACA;AACA;AACA,oBAAoB,wBAAwB;AAC5C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,mBAAmB,eAAe;AAClC;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,cAAc;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACtXA;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAkB,mBAAO,CAAC,2DAAe;;AAEzC;AACA,oBAAoB,mBAAO,CAAC,0DAAI;;AAEhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACtEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,mCAAmC,mBAAmB;AACtD,IAAI,kBAAkB;AACtB;;AAEA,kBAAkB,mBAAO,CAAC,+CAAS;;AAEnC;AACA;AACA;;AAEA;AACA;AACA,0BAA0B,2BAA2B;AACrD;AACA;AACA;AACA,0BAA0B,0BAA0B;AACpD,QAAQ,2BAA2B;AACnC,QAAQ,oCAAoC;AAC5C,eAAe,qBAAqB;AACpC;AACA;AACA;AACA,6BAA6B,YAAY;AACzC;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,gBAAgB,yBAAyB;AACzC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACpEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,uBAAuB,0BAA0B;AACjD;AACA,IAAI,wBAAwB;AAC5B;AACA;AACA;AACA,iBAAiB,gBAAgB;AACjC,+CAA+C,WAAW,GAAG,WAAW;AACxE,IAAI,WAAW;AACf;AACA;AACA;AACA,KAAK,6BAA6B;AAClC,IAAI,wBAAwB;AAC5B,SAAS,wBAAwB;AACjC;AACA;AACA;AACA,oCAAoC,aAAa;AACjD,IAAI,kBAAkB;AACtB;AACA;AACA;;AAEA,YAAY,mBAAO,CAAC,+CAAS;AAC7B,0BAA0B,mBAAO,CAAC,2EAAuB;;AAEzD;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB,uBAAuB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,8C;;;;;;;;;;;ACvGA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB,mBAAO,CAAC,2DAAe;AACzC;AACA,oBAAoB,mBAAO,CAAC,0DAAI;;AAEhC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACzBA;AACA;AACA;AACA;AACA;AACA;;AAEA,YAAY,mBAAO,CAAC,+CAAS;AAC7B,mBAAO,CAAC,+EAAyB;AACjC,mBAAO,CAAC,mFAA2B;;AAEnC;;AAEA;AACA;AACA;AACA;AACA,iBAAiB,2BAA2B;AAC5C;AACA;AACA;AACA;AACA,EAAE;AACF,iBAAiB,2BAA2B;AAC5C;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW;AACX;AACA;AACA,cAAc;AACd;AACA;AACA,oCAAoC;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,2BAA2B;AAC3B;AACA;AACA;;AAEA;AACA;;AAEA,mCAAmC;AACnC;AACA;AACA;AACA;AACA,uBAAuB,cAAc;AACrC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA,sBAAsB,WAAW;AACjC;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;;;;;;ACtIA;AACA;AACA;AACA;;AAEA;;AAEA,YAAY,mBAAO,CAAC,+CAAS;;AAE7B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,iBAAiB,2BAA2B;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB,4BAA4B;AAC7C;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,gBAAgB,yBAAyB;AACzC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,EAAE;AACF,iBAAiB,2BAA2B;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,kCAAkC,iBAAiB;AACnD;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA,KAAK;AACL;AACA,oBAAoB,yBAAyB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB,2BAA2B;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ,EAAE;AACF;AACA,EAAE;AACF;AACA,EAAE;AACF;AACA;AACA;;AAEA;AACA;AACA,gBAAgB,2BAA2B;AAC3C;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,WAAW,yBAAyB;AACpC,EAAE;AACF;AACA;AACA;;;AAGA;AACA;AACA,gBAAgB,2BAA2B;AAC3C;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,WAAW,yBAAyB;AACpC,EAAE;AACF;AACA;AACA;;;AAGA;AACA;AACA,gBAAgB,2BAA2B;AAC3C;AACA,uBAAuB,YAAY;AACnC;AACA;AACA;AACA;AACA,WAAW,yBAAyB;AACpC,EAAE;AACF;AACA;AACA;;AAEA;AACA;AACA;AACA,EAAE;AACF;AACA,EAAE;AACF;AACA;AACA;;AAEA;AACA;;;;;;;;;;;;ACzSA;AACA;AACA;AACA;AACA;AACA;;AAEA,UAAU,mBAAO,CAAC,+CAAS;AAC3B,aAAa,mBAAO,CAAC,+CAAS;AAC9B,YAAY,mBAAO,CAAC,+CAAS;AAC7B,gBAAgB,mBAAO,CAAC,+DAAiB;AACzC,eAAe,mBAAO,CAAC,2DAAe;AACtC,kBAAkB,mBAAO,CAAC,2DAAe;AACzC,oBAAoB,mBAAO,CAAC,6DAAgB;AAC5C,qBAAqB,mBAAO,CAAC,iEAAkB;AAC/C,uBAAuB,mBAAO,CAAC,iEAAkB;AACjD,yBAAyB,mBAAO,CAAC,iEAAkB;AACnD,kCAAkC,mBAAO,CAAC,iEAAkB;;AAE5D,SAAS,mBAAO,CAAC,uEAAqB;AACtC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,oCAAoC,0BAA0B;AAC9D;AACA;;;AAGA;AACA;AACA,UAAU,eAAe;AACzB,2BAA2B,QAAQ;AACnC;AACA,sDAAsD,WAAW;AACjE;AACA;AACA,iEAAiE,QAAQ;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,YAAY;AAC9B;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,0CAA0C,QAAQ;AAClD,cAAc,UAAU;AACxB;AACA,UAAU,UAAU,KAAK,WAAW;AACpC,IAAI,QAAQ,cAAc,qBAAqB;AAC/C,OAAO,UAAU,SAAS,WAAW;AACrC,aAAa,iBAAiB;AAC9B;AACA;AACA;AACA,IAAI,oBAAoB;AACxB,+CAA+C,WAAW;AAC1D;AACA;AACA,8CAA8C,QAAQ;AACtD,cAAc,UAAU;AACxB;AACA;AACA;AACA,4BAA4B,iBAAiB;AAC7C;AACA;AACA;AACA;AACA;;AAEA;AACA,0CAA0C,QAAQ;AAClD,cAAc,UAAU;AACxB;AACA,UAAU,UAAU,KAAK,WAAW,MAAM,gBAAgB;AAC1D,oBAAoB,QAAQ,cAAc,qBAAqB;AAC/D,uBAAuB,UAAU,SAAS,WAAW,MAAM,aAAa;AACxE,IAAI,WAAW,MAAM,gBAAgB;AACrC,aAAa,iBAAiB;AAC9B;AACA;AACA;AACA,IAAI,oBAAoB;AACxB,qCAAqC,WAAW;AAChD;AACA;AACA;AACA;AACA,IAAI,yBAAyB;AAC7B;AACA;AACA,IAAI,mBAAmB;AACvB,wBAAwB,WAAW;AACnC,eAAe,WAAW,oCAAoC;AAC9D,mDAAmD,iBAAiB;AACpE;AACA,sBAAsB,iBAAiB;AACvC,kEAAkE;AAClE,OAAO,WAAW;AAClB;AACA;AACA,2BAA2B,6BAA6B;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,wBAAwB,cAAc;AACtC;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,wBAAwB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,SAAS;AACT;AACA;AACA,aAAa;AACb;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;;ACrMA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,YAAY,mBAAO,CAAC,+CAAS;AAC7B,iBAAiB,mBAAO,CAAC,yDAAc;AACvC,yBAAyB,mBAAO,CAAC,yEAAsB;AACvD,4BAA4B,mBAAO,CAAC,6DAAgB;AACpD,gCAAgC,mBAAO,CAAC,6DAAgB;;AAExD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,qBAAqB;;AAErB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,4BAA4B;AAC5B;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,mCAAmC;AACnC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,gDAAgD;AAChD;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA,CAAC;;;AAGD;AACA;AACA;AACA;;AAEA;AACA,sCAAsC;AACtC;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,EAAE;AACF;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,gBAAgB,cAAc;AAC9B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,EAAE;AACF;AACA,EAAE;AACF;AACA,EAAE;AACF;AACA,EAAE;AACF;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AClXA;AACA;AACA;AACA;;AAEA,YAAY,mBAAO,CAAC,+CAAS;AAC7B,wBAAwB,mBAAO,CAAC,uDAAa;AAC7C,iBAAiB,mBAAO,CAAC,yDAAc;AACvC,2BAA2B,mBAAO,CAAC,2EAAuB;AAC1D,sBAAsB,mBAAO,CAAC,2EAAuB;AACrD,gCAAgC,mBAAO,CAAC,+FAAiC;AACzE,mBAAmB,mBAAO,CAAC,uDAAa;AACxC,gBAAgB,mBAAO,CAAC,uDAAa;;AAErC;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,oDAAoD;AACpD;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,2BAA2B;AAC5C;AACA;AACA;AACA,SAAS,wBAAwB;AACjC;AACA;AACA;AACA,+CAA+C,WAAW;AAC1D;AACA,UAAU,kBAAkB,aAAa;AACzC,KAAK,oBAAoB;AACzB,mBAAmB,kBAAkB,cAAc;AACnD;AACA;AACA;AACA,iBAAiB,wBAAwB;AACzC;AACA;AACA;AACA,2BAA2B,6BAA6B;AACxD;AACA;AACA;AACA;;AAEA;AACA;;AAEA,uEAAuE;AACvE,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,uCAAuC,YAAY;AACnD,aAAa,sCAAsC,MAAM,gBAAgB;AACzE;AACA;AACA;AACA,IAAI,wCAAwC;AAC5C,qCAAqC,0BAA0B;AAC/D,IAAI,WAAW;AACf,IAAI,wCAAwC;AAC5C,8BAA8B,sCAAsC;AACpE;AACA;AACA;AACA;AACA,IAAI,YAAY;AAChB;;AAEA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC;AACvC,QAAQ,gBAAgB;AACxB;AACA;AACA,IAAI,wCAAwC;AAC5C,qCAAqC,0BAA0B;AAC/D,IAAI,WAAW;AACf,IAAI,wCAAwC;AAC5C,8BAA8B,sCAAsC;AACpE;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,cAAc,eAAe;AAC7B;AACA;AACA;AACA;AACA;AACA,IAAI,+BAA+B;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,MAAM,cAAc;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,WAAW,eAAe;AAC1B;AACA,UAAU,eAAe,KAAK,WAAW;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB,2BAA2B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,4DAA4D,MAAM;AAClE;AACA;AACA;AACA;;AAEA,YAAY,mBAAO,CAAC,+CAAS;;AAE7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,+CAA+C;AAC/C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,2BAA2B,4CAA4C;AACvE;AACA,4CAA4C,QAAQ;AACpD,wDAAwD,QAAQ;AAChE,IAAI,QAAQ;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,yCAAyC;AACrE,IAAI,uCAAuC;AAC3C;AACA;AACA,IAAI,6CAA6C;AACjD,IAAI,wCAAwC;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,IAAI,aAAa;;AAEjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA;;AAEA;AACA,SAAS,kBAAkB;;AAE3B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA;;AAEA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,0BAA0B,aAAa;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,WAAW,KAAK,aAAa;AACzC,uBAAuB,YAAY;;AAEnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;;AAEA;AACA,mCAAmC,iBAAiB,MAAM,mBAAmB;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,8BAA8B,oBAAoB;AAClD;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;;AAEA,kBAAkB,UAAU;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,uCAAuC;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,0BAA0B;AAC1B,iCAAiC,gDAAgD,EAAE;AACnF,+BAA+B,wCAAwC,EAAE;AACzE,MAAM;AACN;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,wB;;;;;;;;;;;ACjqBA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAkB,mBAAO,CAAC,2DAAe;AACzC,WAAW,mBAAO,CAAC,uDAAa;AAChC;AACA;AACA;AACA;AACA,eAAe,mBAAO,CAAC,2DAAe;;AAEtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,WAAW;AACtC;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF,cAAc,wBAAwB;AACtC;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA,aAAa,wBAAwB;AACrC;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA,cAAc,wBAAwB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA,cAAc,wBAAwB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,8C;;;;;;;;;;;AChOA;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAkB,mBAAO,CAAC,2DAAe;AACzC,WAAW,mBAAO,CAAC,+CAAS;;AAE5B;AACA;AACA;;AAEA,eAAe,QAAQ;AACvB,IAAI,cAAc;AAClB;AACA;;AAEA,eAAe,QAAQ,yCAAyC;AAChE,2BAA2B,oBAAoB;AAC/C,IAAI,QAAQ,IAAI,2BAA2B;AAC3C;AACA;;AAEA;AACA;;AAEA,0CAA0C,wBAAwB;AAClE;AACA;AACA;AACA;AACA,eAAe,mDAAmD,EAAE;AACpE,kBAAkB;AAClB;AACA,kBAAkB,OAAO,EAAE,gBAAgB;AAC3C,WAAW,2CAA2C,QAAQ;AAC9D,aAAa;AACb;AACA;AACA,kBAAkB,OAAO,EAAE,gBAAgB;AAC3C,WAAW,2CAA2C,QAAQ;AAC9D,mCAAmC;AACnC;AACA;AACA,WAAW,2CAA2C,YAAY;AAClE,YAAY;AACZ;AACA;AACA;AACA;;AAEA,wBAAwB,cAAc;AACtC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAkB,wBAAwB;AAC1C;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,EAAE;AACF;AACA,EAAE;AACF,eAAe;AACf,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,EAAE;AACF;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,UAAU,cAAc,0BAA0B,cAAc;AAChE;AACA,oBAAoB,2BAA2B;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,EAAE;AACF;AACA,EAAE;AACF,eAAe;AACf,EAAE;AACF;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,EAAE;AACF;AACA,iBAAiB,8BAA8B;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;;AAEA,cAAc,kBAAkB,YAAY,wBAAwB;AACpE,WAAW,cAAc,KAAK,mBAAmB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,cAAc,iCAAiC;AAC/C;AACA,8CAA8C;AAC9C;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB,wBAAwB;AACxB,0BAA0B,WAAW;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,OAAO;AACT;AACA;AACA,yEAAyE;AACzE;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA,sCAAsC;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,sCAAsC,QAAQ,KAAK,QAAQ;AAC3D,IAAI,cAAc,yCAAyC,QAAQ;AACnE,iBAAiB,cAAc;AAC/B;AACA;AACA;AACA,0DAA0D;AAC1D;AACA;AACA,OAAO,cAAc,0BAA0B,SAAS,cAAc;AACtE;AACA;AACA,OAAO,cAAc,kBAAkB,cAAc;AACrD,IAAI,eAAe;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD;AACzD;AACA;AACA;AACA;AACA,6BAA6B,EAAE,cAAc;AAC7C;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB,wBAAwB;AACxB,0BAA0B,WAAW;AACrC;AACA;AACA;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA,kCAAkC;AAClC;AACA,EAAE;AACF;AACA,kCAAkC;AAClC,GAAG,0CAA0C;AAC7C;AACA;AACA;AACA;AACA,GAAG,0CAA0C;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,cAAc,6BAA6B;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,iCAAiC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,WAAW;AACX,WAAW;;AAEX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iFAAiF;AACjF;AACA;AACA;AACA,gCAAgC;AAChC;AACA,IAAI,OAAO;AACX;AACA;AACA;AACA;AACA,UAAU;AACV,UAAU;AACV,GAAG,kDAAkD;AACrD;AACA;AACA;AACA,GAAG,OAAO;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,2BAA2B;AAC5C;AACA;AACA;AACA;AACA,EAAE;AACF,iBAAiB,2BAA2B;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,gCAAgC;AAChE,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,kCAAkC,eAAe,YAAY;AAC7D;AACA;AACA;AACA;;AAEA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA,mBAAmB,oBAAoB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA,iBAAiB,oBAAoB;AACrC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC1tBA;AACA;AACA;AACA;AACA;AACA;;AAEA,YAAY,mBAAO,CAAC,+CAAS;AAC7B,2BAA2B,mBAAO,CAAC,2EAAuB;AAC1D,yBAAyB,mBAAO,CAAC,2EAAuB;;AAExD;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD,UAAU,EAAE;AAClE;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,UAAU,EAAE;AACjE;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,yBAAyB;AAChD;AACA,IAAI,iDAAiD;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA,CAAC;;;AAGD;;;;;;;;;;;;AClJA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,eAAe,mBAAO,CAAC,uDAAa;AACpC,uBAAuB,mBAAO,CAAC,uDAAa;AAC5C,yBAAyB,mBAAO,CAAC,mDAAW;;AAE5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,oDAAoD;AACpD;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,2BAA2B;;AAE5E;AACA;AACA;AACA;AACA;AACA,0DAA0D;;AAE1D;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,YAAY,mBAAO,CAAC,yDAAc;;;AAGlC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC3JA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,kBAAkB;AAClB,qBAAqB;AACrB,mBAAmB,aAAa;AAChC,kBAAkB,aAAa;AAC/B,wBAAwB;AACxB,kBAAkB;AAClB,oBAAoB;AACpB,mBAAmB;AACnB;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA,+CAA+C,UAAU;AACzD,IAAI,WAAW,QAAQ,gBAAgB;AACvC;AACA;AACA,mDAAmD,WAAW;AAC9D;AACA;;AAEA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;;AAEA;AACA;;AAEA,aAAa,WAAW;AACxB,IAAI,eAAe;AACnB;;AAEA,qBAAqB,kBAAkB,uBAAuB,YAAY;AAC1E;AACA;AACA,OAAO,eAAe,YAAY,kBAAkB;AACpD,oDAAoD,aAAa;AACjE,QAAQ,WAAW,YAAY,eAAe,cAAc,aAAa;AACzE,sCAAsC,gBAAgB,OAAO;AAC7D,2CAA2C,4BAA4B;AACvE,IAAI,4BAA4B;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,EAAE;AACF;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;;;;;ACtJA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA,+BAA+B;AAC/B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,uBAAuB,mBAAmB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,uBAAuB,mBAAmB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA,aAAa,iCAAiC;AAC9C;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA,uBAAuB,oBAAoB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,qBAAqB;AAC3C;AACA,KAAK;AACL,+BAA+B,qBAAqB;AACpD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,uBAAuB,oBAAoB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,uBAAuB,oBAAoB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,KAAK;AACL;;;AAGA;AACA;AACA;AACA,KAAK;AACL;;;AAGA;AACA;AACA,iBAAiB,sCAAsC;AACvD,KAAK;AACL;AACA;;;AAGA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,gBAAgB,mBAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,cAAc;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC7bA;AACA;AACA;AACA;;AAEA,kBAAkB,mBAAO,CAAC,8DAAkB;AAC5C,kBAAkB,mBAAO,CAAC,8DAAkB;;AAE5C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR,4CAA4C,qBAAqB,WAAW;AAC5E;AACA,4CAA4C,kBAAkB;AAC9D;AACA;AACA;;AAEA;AACA;;AAEA,qEAAqE,QAAQ;AAC7E,QAAQ,UAAU;AAClB,0BAA0B,QAAQ;AAClC,mDAAmD,QAAQ;AAC3D;AACA;AACA;AACA;;AAEA,+DAA+D,QAAQ;AACvE,0BAA0B,qBAAqB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,0CAA0C;AAC1C;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA,IAAI,kBAAkB,wBAAwB,cAAc;AAC5D;AACA;AACA;AACA,IAAI,oBAAoB;AACxB,aAAa,iBAAiB;AAC9B;AACA,UAAU,cAAc,KAAK,WAAW;AACxC,IAAI,+BAA+B;AACnC;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,YAAY,mBAAO,CAAC,kDAAY;;AAEhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,kB;;;;;;;;;;;AC7IA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,oBAAoB,mBAAO,CAAC,yDAAY;AACxC,sBAAsB,mBAAO,CAAC,uEAAmB;AACjD,WAAW,mBAAO,CAAC,gDAAU;;;AAG7B;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC;AAChC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;;AAEA,sCAAsC,+BAA+B;AACrE;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA,wC;;;;;;;;;;;AC/KA;AACA;AACA;AACA;AACA;;AAEA;AACA,gBAAgB,WAAW,SAAS,iBAAiB,QAAQ;AAC7D;AACA;AACA;;AAEA,UAAU,mBAAO,CAAC,+CAAO;AACzB,YAAY,mBAAO,CAAC,kDAAY;AAChC;AACA;AACA,sBAAsB,mBAAO,CAAC,uEAAmB;AACjD,YAAY,mBAAO,CAAC,0EAAwB;;AAE5C;AACA;AACA;;AAEA;AACA;AACA;AACA,EAAE;AACF;AACA,EAAE;AACF;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA,KAAK,qBAAqB;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC;AACzC;AACA,WAAW;AACX;AACA;AACA,oDAAoD;AACpD;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA,IAAI,oBAAoB,SAAS,QAAQ;AACzC,IAAI,uBAAuB,GAAG,QAAQ,SAAS,qBAAqB;AACpE,IAAI,SAAS,SAAS,iCAAiC;AACvD,IAAI,eAAe;AACnB;AACA,2BAA2B,6BAA6B;AACxD,IAAI,2BAA2B;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,oBAAoB;AAC/C;AACA;;AAEA;AACA;AACA,gBAAgB,yBAAyB;AACzC;AACA;AACA;AACA;;AAEA;AACA;AACA,gBAAgB,yBAAyB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,yBAAyB;AACzC;AACA;AACA;AACA;;AAEA;AACA,gBAAgB,iBAAiB;AACjC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;;;;;AC9PA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACxBA;AACA;AACA;AACA;;AAEA,YAAY,mBAAO,CAAC,kDAAY;AAChC,UAAU,mBAAO,CAAC,+CAAO;AACzB,cAAc,mBAAO,CAAC,uDAAW;AACjC,gBAAgB,mBAAO,CAAC,yDAAY;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,mBAAO,CAAC,6DAAc;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,mBAAO,CAAC,8DAAkB;AAC5C,eAAe,mBAAO,CAAC,8DAAkB;AACzC,gCAAgC,mBAAO,CAAC,2FAA6B;AACrE,mBAAmB,mBAAO,CAAC,+DAAe;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,6BAA6B,cAAc;AAC3C;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,4CAA4C,WAAW;AACvD;AACA;AACA,uBAAuB,WAAW;AAClC;AACA,0BAA0B,WAAW;AACrC;AACA,YAAY,WAAW,SAAS,iBAAiB;AACjD,yDAAyD,cAAc;AACvE,cAAc,aAAa,YAAY;;AAEvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,gBAAgB,WAAW;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C;AAC1C;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,+BAA+B;AAC5C;AACA;AACA;;AAEA,aAAa,0BAA0B;AACvC;AACA;AACA;;AAEA;AACA,aAAa,sBAAsB;AACnC;AACA;AACA;;AAEA;AACA,aAAa,uBAAuB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,UAAU;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,qBAAqB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB,KAAK;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,KAAK;AAC1B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,UAAU;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,qBAAqB;AAClC;AACA,iBAAiB,4BAA4B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,aAAa,qBAAqB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,4BAA4B;AACjD;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,qBAAqB,4BAA4B;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB,cAAc;AAC/B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,qBAAqB,SAAS;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY,SAAS;AACrB;AACA;AACA,YAAY,SAAS;AACrB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,gBAAgB,qBAAqB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA,YAAY,qBAAqB;AACjC;AACA,oBAAoB,4BAA4B;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA,gBAAgB,yBAAyB;AACzC,QAAQ,+CAA+C;AACvD;AACA;AACA;AACA;AACA;AACA,aAAa,qBAAqB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa,qBAAqB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,gBAAgB,SAAS;AACzB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,yCAAyC,yBAAyB;AAClE,8CAA8C,6BAA6B;AAC3E,+CAA+C,mCAAmC;AAClF,oDAAoD,kCAAkC;AACtF,oDAAoD,kCAAkC;AACtF,+CAA+C,+BAA+B;AAC9E,6CAA6C,4BAA4B;AACzE,6CAA6C,4BAA4B;AACzE,kDAAkD,gCAAgC;AAClF,mDAAmD,iCAAiC;AACpF,kDAAkD,gCAAgC;AAClF,4CAA4C,2BAA2B;AACvE;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,8DAA8D,sCAAsC;AACpG,6DAA6D,4CAA4C;AACzG,2DAA2D,mCAAmC;AAC9F,2DAA2D,iCAAiC;AAC5F,+DAA+D,oCAAoC;AACnG,gEAAgE,uCAAuC;AACvG,2DAA2D,iCAAiC;AAC5F,2DAA2D,mCAAmC;AAC9F;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;;AAGA,0C;;;;;;;;;;;ACrqBA;AACA;AACA;AACA;AACA;AACA;;AAEA,eAAe,mBAAO,CAAC,gEAAmB;AAC1C,mBAAmB,mBAAO,CAAC,iEAAgB;AAC3C,iCAAiC,mBAAO,CAAC,0EAAwB;;AAEjE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AClDA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,IAAI,4BAA4B;AAChC;AACA;AACA;AACA,0CAA0C;AAC1C,IAAI,wBAAwB;AAC5B;AACA;AACA,IAAI,iBAAiB;AACrB;AACA;AACA,IAAI,iBAAiB;AACrB;AACA;AACA,4DAA4D,UAAU;AACtE,gEAAgE,UAAU;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,aAAa;AACrC;AACA;AACA;AACA,iCAAiC,aAAa;AAC9C;AACA;AACA;AACA,yBAAyB,aAAa;AACtC;AACA;AACA;AACA;AACA;AACA,4BAA4B,cAAc;AAC1C;AACA;AACA;AACA,qCAAqC,cAAc;AACnD;AACA;AACA;AACA,6BAA6B,cAAc;AAC3C;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA,4BAA4B,YAAY;AACxC;AACA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA,8BAA8B,cAAc;AAC5C;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,uBAAuB,SAAS,MAAM,aAAa;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA,aAAa,iBAAiB;AAC9B,qCAAqC;AACrC,0CAA0C,wBAAwB;AAClE,mCAAmC,SAAS;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACrUA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;;;;;;;;;;;;ACfA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAS,sBAAsB;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,YAAY,mBAAO,CAAC,kDAAY;AAChC,YAAY,mBAAO,CAAC,kDAAY;AAChC,UAAU,mBAAO,CAAC,+CAAO;AACzB,mBAAmB,mBAAO,CAAC,iEAAgB;AAC3C,eAAe,mBAAO,CAAC,gEAAmB;AAC1C,mBAAmB,mBAAO,CAAC,iEAAgB;AAC3C,0BAA0B,mBAAO,CAAC,iEAAgB;AAClD,wBAAwB,mBAAO,CAAC,0EAAwB;AACxD,iCAAiC,mBAAO,CAAC,0EAAwB;AACjE,oBAAoB,mBAAO,CAAC,yDAAY;AACxC,qBAAqB,mBAAO,CAAC,2DAAa;AAC1C,iBAAiB,mBAAO,CAAC,6DAAc;AACvC,0BAA0B,mBAAO,CAAC,+EAAuB;AACzD,gCAAgC,mBAAO,CAAC,gEAAmB;;AAE3D;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,qCAAqC;;AAErC;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,EAAE;AACF;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;;AAEb,eAAe;AACf;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,SAAS;AACtB;AACA;AACA;;AAEA;AACA;AACA,wBAAwB,WAAW;AACnC;AACA;AACA;AACA;AACA,IAAI,QAAQ,MAAM,WAAW;AAC7B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,QAAQ,MAAM,QAAQ;AAC1B,YAAY,cAAc;AAC1B;AACA;AACA;AACA;AACA;;AAEA,gCAAgC;AAChC;AACA,0DAA0D;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,4BAA4B,QAAQ,aAAa,YAAY;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,0BAA0B;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,kCAAkC;AACnD,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,sDAAsD;AAC3F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;;AAEA;AACA;AACA;AACA,gBAAgB,0BAA0B;AAC1C;AACA,sCAAsC,8CAA8C;AACpF;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,gBAAgB,aAAa;AAC7B;AACA;AACA,YAAY,WAAW;AACvB,IAAI,YAAY;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ,oCAAoC,qDAAqD;AACzF;AACA;AACA;AACA;AACA,kBAAkB,2BAA2B;AAC7C;AACA,kDAAkD;AAClD;AACA,+BAA+B,wCAAwC;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,qCAAqC;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,wCAAwC;AACrE,EAAE;AACF;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,aAAa,GAAG,QAAQ,GAAG;;AAE3B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,6BAA6B,oBAAoB;AACjD;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,8DAA8D;AAC3F,GAAG;AACH;AACA,8BAA8B,oBAAoB;AAClD;AACA,EAAE;AACF,4BAA4B,oBAAoB;AAChD,EAAE;AACF;AACA;AACA;AACA;AACA,+BAA+B,qBAAqB;AACpD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,UAAU,kBAAkB,KAAK,WAAW;AAC5C,IAAI,gBAAgB;AACpB,IAAI,gBAAgB;AACpB,gCAAgC,qBAAqB,GAAG,qBAAqB;AAC7E,QAAQ,uBAAuB;AAC/B,4CAA4C,YAAY;AACxD;AACA,YAAY,gBAAgB;AAC5B;AACA;AACA;AACA;AACA,uBAAuB,WAAW,0BAA0B,YAAY;AACxE;AACA;AACA,YAAY,WAAW;AACvB,IAAI,WAAW;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD;;AAEvD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,0BAA0B;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;;AAEA;;;;;;;;;;;;AC3nBA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,4BAA4B,sBAAsB,yBAAyB;AAC3E,2BAA2B,uBAAuB,wBAAwB;AAC1E,yBAAyB,yBAAyB,sBAAsB;AACxE,yBAAyB,yBAAyB,sBAAsB;AACxE,6BAA6B,qBAAqB,yBAAyB;AAC3E,8BAA8B,oBAAoB,0BAA0B;AAC5E,yBAAyB,yBAAyB,sBAAsB;AACxE,yBAAyB,yBAAyB,sBAAsB;;AAExE;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;;;AAIA;AACA,mBAAmB,WAAW,0BAA0B,kBAAkB;AAC1E;AACA,WAAW,WAAW;AACtB,mDAAmD,iBAAiB;AACpE;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,oBAAoB,WAAW,0BAA0B;AACzD;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;;AAEA,mBAAmB,eAAe;AAClC,IAAI,sBAAsB;AAC1B;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,6CAA6C,sBAAsB;AACnE,sBAAsB,gBAAgB;AACtC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;;;AAGA,mBAAmB,cAAc,0BAA0B,qBAAqB;AAChF;AACA,WAAW,cAAc;AACzB,mDAAmD,iBAAiB;AACpE;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA,6CAA6C,qBAAqB;AAClE;AACA;AACA;;AAEA;AACA;AACA;;AAEA,mBAAmB,WAAW,0BAA0B,kBAAkB;AAC1E;AACA,WAAW,WAAW;AACtB,mDAAmD,iBAAiB;AACpE;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA,6CAA6C,qBAAqB;AAClE;AACA;AACA;;AAEA;AACA;AACA;;;AAGA,mBAAmB,WAAW,0BAA0B,kBAAkB;AAC1E;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,6CAA6C,kBAAkB;AAC/D,sBAAsB,gBAAgB;AACtC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;;AAEA,8CAA8C,yBAAyB;AACvE;AACA;AACA,OAAO,yBAAyB;AAChC;AACA,wEAAwE,IAAI;AAC5E;AACA;;;AAGA;AACA;AACA;AACA;AACA,QAAQ,yBAAyB;AACjC;AACA,QAAQ,yBAAyB;;AAEjC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,iDAAiD,oBAAoB;AACrE;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;;AAEA,mBAAmB,cAAc;AACjC,IAAI,wBAAwB;AAC5B,qBAAqB,cAAc;AACnC,gDAAgD,wBAAwB;AACxE;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,6CAA6C,wBAAwB;AACrE,sBAAsB,mBAAmB;AACzC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;;AAEA,2BAA2B,kBAAkB;AAC7C,4CAA4C,0BAA0B;AACtE;AACA;AACA;AACA;AACA,uBAAuB,kCAAkC;AACzD,IAAI,gDAAgD;;AAEpD;AACA,WAAW,kBAAkB;AAC7B;AACA;AACA,IAAI,uCAAuC,UAAU,WAAW;AAChE;AACA,4CAA4C,iBAAiB;AAC7D;AACA;AACA;AACA,UAAU,iBAAiB;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,yBAAyB,gBAAgB,mBAAmB;AAC5D,uBAAuB,YAAY;AACnC;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0C;;;;;;;;;;;AC7WA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,8BAA8B,UAAU;;AAExC,gBAAgB,mBAAO,CAAC,gDAAU;AAClC,+BAA+B,mBAAO,CAAC,+DAAe;;AAEtD;AACA;AACA,0BAA0B,iBAAiB;AAC3C,iCAAiC,+BAA+B;AAChE,+CAA+C;AAC/C;AACA;AACA;;AAEA,cAAc,0BAA0B;AACxC,cAAc,0BAA0B;AACxC,IAAI,kBAAkB;AACtB;AACA;AACA;AACA,IAAI,qBAAqB,cAAc,WAAW;AAClD;AACA;AACA,iBAAiB,0BAA0B;AAC3C;AACA,cAAc,0BAA0B;AACxC,OAAO,0BAA0B,MAAM,kBAAkB;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,cAAc,0BAA0B;AACxC;AACA;AACA;AACA,IAAI,uCAAuC,UAAU,WAAW;AAChE,IAAI,sBAAsB,eAAe,iBAAiB;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,WAAW;AACpE;AACA;AACA;AACA;AACA,cAAc,0BAA0B;AACxC;AACA;AACA;AACA;AACA,gBAAgB,8BAA8B;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;;AAEA;AACA,eAAe,YAAY;AAC3B;AACA,yBAAyB,sBAAsB;AAC/C,IAAI,YAAY,EAAE,iBAAiB;AACnC,IAAI,2BAA2B;AAC/B;AACA;AACA;AACA;AACA;AACA,4CAA4C,uBAAuB;AACnE,IAAI,YAAY;AAChB;AACA;AACA,IAAI,sBAAsB,aAAa,YAAY;AACnD;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,8BAA8B;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;AACA,EAAE;AACF;AACA,EAAE;AACF;AACA,EAAE;AACF;AACA,EAAE;AACF;AACA,mBAAmB,kBAAkB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACrKA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,qBAAqB;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,4EAA4E;AAC5E,2CAA2C;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,sBAAsB;AAC/B,IAAI,6BAA6B;AACjC,IAAI,wBAAwB;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,yBAAyB,eAAe,sBAAsB;AACtE,4CAA4C;AAC5C;AACA,IAAI,sBAAsB,SAAS,oBAAoB;AACvD;AACA;AACA;AACA;AACA,IAAI,oBAAoB;AACxB;AACA,oBAAoB,wBAAwB;AAC5C;AACA;AACA,IAAI,gBAAgB,+BAA+B,eAAe;AAClE,IAAI,WAAW;AACf,IAAI,kBAAkB,sBAAsB,sBAAsB;AAClE,gDAAgD,sBAAsB;AACtE,IAAI,WAAW,aAAa,WAAW,MAAM,mBAAmB;AAChE,IAAI,mBAAmB;AACvB,IAAI,mBAAmB;AACvB,8CAA8C,KAAK,WAAW;AAC9D,iDAAiD,mBAAmB;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,wBAAwB;AAC1C;AACA;AACA,WAAW,gDAAgD,EAAE,6CAA6C,SAAS,2BAA2B;AAC9I,WAAW,8CAA8C,MAAM,wBAAwB;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,OAAO,SAAS;AAC5E,yDAAyD,OAAO,MAAM;AACtE;AACA,kBAAkB,OAAO,MAAM,KAAK,OAAO,MAAM;AACjD;AACA,0BAA0B,OAAO,GAAG,KAAK,OAAO,GAAG;AACnD,4BAA4B,OAAO,GAAG;AACtC;AACA;AACA;AACA;AACA;AACA;;AAEA,YAAY,mBAAO,CAAC,kDAAY;AAChC;AACA;AACA;AACA,UAAU,mBAAO,CAAC,+CAAO;AACzB,eAAe,mBAAO,CAAC,yDAAY;AACnC,gBAAgB,mBAAO,CAAC,2DAAa;AACrC,mBAAmB,mBAAO,CAAC,iEAAgB;AAC3C,YAAY,mBAAO,CAAC,kDAAY;AAChC,eAAe,mBAAO,CAAC,gEAAmB;AAC1C,qBAAqB,mBAAO,CAAC,gEAAmB;AAChD,mBAAmB,mBAAO,CAAC,iEAAgB;AAC3C,qBAAqB,mBAAO,CAAC,qEAAkB;AAC/C,kBAAkB,mBAAO,CAAC,8DAAkB;AAC5C,wBAAwB,mBAAO,CAAC,0EAAwB;AACxD,sBAAsB,mBAAO,CAAC,uEAAmB;AACjD,yBAAyB,mBAAO,CAAC,yDAAY;AAC7C,oBAAoB,mBAAO,CAAC,yDAAY;AACxC,wBAAwB,mBAAO,CAAC,0EAAwB;AACxD,eAAe,mBAAO,CAAC,8DAAkB;AACzC,kBAAkB,mBAAO,CAAC,6DAAc;AACxC;AACA;AACA;AACA;AACA;AACA,2BAA2B,mBAAO,CAAC,gEAAmB;;AAEtD,iCAAiC,mBAAO,CAAC,0EAAwB;AACjE,uCAAuC,mBAAO,CAAC,0EAAwB;;AAEvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gEAAgE;AAChE,sEAAsE;AACtE;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C;AAC5C;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,+BAA+B;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,WAAW;AACnC;AACA;AACA;AACA;AACA,IAAI,QAAQ,MAAM,WAAW;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,QAAQ,MAAM,QAAQ;AAC1B,YAAY,cAAc;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD;AACrD,KAAK;AACL;AACA,oCAAoC,EAAE;AACtC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,oBAAoB,KAAK,GAAG,KAAK,GAAG,EAAE,GAAG,KAAK;;AAE9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,iBAAiB,wBAAwB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,6BAA6B;AACjD;AACA;AACA;AACA,yCAAyC,aAAa;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD;AAChD;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,6BAA6B;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,4BAA4B;AACjD;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,IAAI,cAAc,iBAAiB,oBAAoB;AACvD,sBAAsB,cAAc;AACpC,0BAA0B,cAAc;AACxC;AACA,YAAY,sBAAsB;AAClC,IAAI,sBAAsB,4BAA4B,cAAc;AACpE;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,cAAc;AAClB;AACA,YAAY,cAAc,2BAA2B,cAAc;AACnE;AACA,4BAA4B,cAAc;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,wBAAwB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,qBAAqB;AAC/D;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,gBAAgB,uBAAuB;AACvC;AACA,+BAA+B,gDAAgD;AAC/E;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,IAAI,0BAA0B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,sCAAsC;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,UAAU,KAAK,cAAc;AAC3C;AACA,IAAI,gBAAgB;AACpB;AACA,yBAAyB,WAAW,uBAAuB;AAC3D;AACA;AACA;AACA;AACA,IAAI,0BAA0B;AAC9B;AACA;AACA,YAAY,4BAA4B;AACxC;AACA;AACA;AACA;AACA;AACA,gBAAgB,wBAAwB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,+BAA+B;AACxE,SAAS;AACT;AACA;AACA;AACA,YAAY,wBAAwB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,WAAW;AACzB;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB,oBAAoB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAI,2BAA2B;AAC/B,IAAI,cAAc;AAClB;AACA;AACA;AACA;AACA;AACA,IAAI,wBAAwB;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,8BAA8B;AACxD;AACA;AACA;AACA;AACA,uCAAuC,+BAA+B;AACtE;AACA;AACA;AACA,IAAI,wBAAwB;AAC5B,IAAI,2BAA2B;AAC/B,IAAI,+BAA+B;AACnC;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,cAAc;AACtB;AACA;AACA;AACA,qCAAqC,wBAAwB;AAC7D,IAAI,8BAA8B;AAClC,mBAAmB,wBAAwB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC;AACvC;AACA;AACA;AACA;AACA;AACA,2CAA2C;AAC3C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;AAEA;AACA,uBAAuB,WAAW;AAClC;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,yBAAyB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,yBAAyB;AACpD;AACA;AACA,mDAAmD,oDAAoD;AACvG;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6DAA6D;AAC7D,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,uBAAuB;AACzC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C;AAC/C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,oDAAoD;AACpD;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,gBAAgB,WAAW,OAAO;AAClC;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,gBAAgB,WAAW,OAAO;AAClC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,oCAAoC;AACpC;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,eAAe;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,gBAAgB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,0BAA0B,eAAe;AACzC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,gBAAgB,UAAU;AAC7D;AACA,SAAS;AACT;AACA,+BAA+B,2CAA2C;AAC1E;AACA,KAAK;AACL,2BAA2B,gBAAgB;AAC3C;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,gBAAgB,UAAU;AAC7D;AACA,SAAS;AACT;AACA,+BAA+B,2CAA2C;AAC1E;AACA,KAAK;AACL,2BAA2B,gBAAgB;AAC3C;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,mCAAmC;AAC7D;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA,uDAAuD;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,eAAe;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,IAAI,oBAAoB,gBAAgB,SAAS;AACjD,YAAY,WAAW,KAAK,WAAW,SAAS,QAAQ;AACxD;AACA;AACA;AACA,UAAU,SAAS,KAAK,WAAW,uBAAuB,WAAW;AACrE,uCAAuC,eAAe;AACtD,IAAI,oBAAoB,UAAU,SAAS;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAAS,KAAK,WAAW,uBAAuB;AAC/D,wDAAwD;AACxD,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B;;AAE1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,QAAQ;AACtB,oEAAoE;AACpE;AACA,mBAAmB,QAAQ;AAC3B;AACA,UAAU,QAAQ,KAAK,cAAc,uBAAuB,cAAc;AAC1E;AACA;AACA;AACA;AACA;AACA,aAAa,QAAQ,4BAA4B,QAAQ;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,gD;;;;;;;;;;;AC/rDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,UAAU,mBAAO,CAAC,kDAAY;AAC9B,UAAU,mBAAO,CAAC,kDAAY;AAC9B,aAAa,mBAAO,CAAC,kDAAY;AACjC,cAAc,mBAAO,CAAC,kDAAY;AAClC,UAAU,mBAAO,CAAC,+CAAO;AACzB,oBAAoB,mBAAO,CAAC,yDAAY;AACxC,mBAAmB,mBAAO,CAAC,iEAAgB;AAC3C,gBAAgB,mBAAO,CAAC,2DAAa;AACrC,sBAAsB,mBAAO,CAAC,uEAAmB;AACjD,WAAW,mBAAO,CAAC,gDAAU;AAC7B,gBAAgB,mBAAO,CAAC,kDAAY;AACpC,kBAAkB,mBAAO,CAAC,kDAAY;;AAEtC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,WAAW;AACf,+CAA+C,YAAY;AAC3D;AACA;AACA,aAAa,WAAW;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,WAAW;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,KAAK,MAAM,OAAO,KAAK;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,sDAAsD,IAAI;AACjE;AACA,wDAAwD,QAAQ,EAAE;AAClE,+BAA+B,iCAAiC;AAChE,IAAI,cAAc,MAAM,cAAc;AACtC;AACA,QAAQ,eAAe;AACvB;AACA;AACA;AACA,OAAO,iDAAiD;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,mBAAmB;AAC/C;AACA;AACA;AACA,OAAO,kBAAkB,eAAe,EAAE,EAAE;AAC5C;AACA;AACA,IAAI,QAAQ,MAAM,SAAS;AAC3B,yBAAyB,kBAAkB;AAC3C;AACA;AACA,OAAO,kBAAkB,eAAe,EAAE,iBAAiB,EAAE;AAC7D;AACA;AACA,IAAI,uCAAuC;AAC3C;AACA,IAAI,mBAAmB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA,mCAAmC,qCAAqC;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,mCAAmC,cAAc;AACjD,IAAI,oBAAoB;AACxB;AACA;AACA;AACA;AACA,YAAY,WAAW,0BAA0B,cAAc;AAC/D,IAAI,oBAAoB,aAAa;AACrC;AACA,aAAa,uBAAuB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,oCAAoC,cAAc;AAClD,IAAI,oBAAoB;AACxB;AACA;AACA;AACA;AACA,YAAY,WAAW,2BAA2B,cAAc;AAChE,IAAI,oBAAoB,aAAa;AACrC;AACA,aAAa,uBAAuB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,QAAQ;AACpE,wBAAwB,qBAAqB;AAC7C;AACA,cAAc,uBAAuB,MAAM,yBAAyB;AACpE,kBAAkB,qBAAqB,cAAc;AACrD,QAAQ,qBAAqB,MAAM,WAAW;AAC9C;AACA;AACA;AACA;AACA,OAAO,iBAAiB,oBAAoB;AAC5C,IAAI,QAAQ,UAAU,QAAQ,MAAM,UAAU;AAC9C;AACA,iDAAiD,QAAQ,KAAK,QAAQ;AACtE;AACA;AACA,gBAAgB,yBAAyB;AACzC;AACA;AACA;AACA,qBAAqB,UAAU,iBAAiB,cAAc;AAC9D;AACA,UAAU,kBAAkB;AAC5B,IAAI,QAAQ,MAAM,UAAU;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,gBAAgB,MAAM,iBAAiB;AACjE,SAAS,WAAW,MAAM,WAAW;AACrC,IAAI,gBAAgB;AACpB,SAAS,QAAQ,uCAAuC,QAAQ;AAChE,IAAI,QAAQ;AACZ,wDAAwD,QAAQ;AAChE,IAAI,SAAS;AACb,6DAA6D,QAAQ;AACrE,IAAI,SAAS,UAAU,QAAQ,qCAAqC;AACpE,0BAA0B,QAAQ;AAClC,sBAAsB,aAAa,uBAAuB,QAAQ;AAClE,oBAAoB,UAAU;AAC9B,IAAI,QAAQ,sCAAsC,QAAQ;AAC1D;AACA;AACA,0DAA0D,QAAQ;AAClE,IAAI,SAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,sBAAsB;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D;AAC5D;AACA,SAAS,gBAAgB,GAAG,gBAAgB,GAAG,gBAAgB;AAC/D,IAAI,iBAAiB,GAAG,iBAAiB;AACzC,IAAI,OAAO,GAAG,qBAAqB,WAAW,IAAI,EAAE,IAAI,WAAW,IAAI,EAAE;AACzE,IAAI,OAAO,KAAK,MAAM;AACtB;AACA;AACA,QAAQ,gBAAgB,GAAG,gBAAgB,GAAG,iBAAiB;AAC/D,IAAI,iBAAiB,GAAG,kBAAkB;AAC1C,IAAI,OAAO,GAAG,qBAAqB,WAAW,IAAI,EAAE,IAAI,WAAW,IAAI,EAAE;AACzE,IAAI,OAAO,GAAG,MAAM;AACpB;AACA,QAAQ,gBAAgB,GAAG,gBAAgB,GAAG,iBAAiB;AAC/D,IAAI,iBAAiB,mCAAmC,OAAO,GAAG;AAClE,IAAI,OAAO,GAAG,IAAI,OAAO,GAAG,MAAM;AAClC,cAAc,OAAO,KAAK;AAC1B;AACA,QAAQ,gBAAgB,GAAG,gBAAgB,GAAG,iBAAiB;AAC/D,IAAI,iBAAiB,mCAAmC,OAAO,GAAG;AAClE,IAAI,OAAO,GAAG,IAAI,OAAO,KAAK,MAAM;AACpC;AACA,QAAQ,gBAAgB,GAAG,gBAAgB,GAAG,iBAAiB;AAC/D,IAAI,iBAAiB,mCAAmC,OAAO,GAAG;AAClE,IAAI,OAAO,GAAG,IAAI,OAAO,KAAK,MAAM;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA,iEAAiE;AACjE,2CAA2C,UAAU;AACrD,IAAI,UAAU,IAAI,GAAG,MAAM;AAC3B,gCAAgC,OAAO,GAAG;AAC1C;AACA;AACA;AACA,IAAI,UAAU,MAAM,KAAK,QAAQ,IAAI,EAAE,MAAM;AAC7C;AACA;AACA;AACA;;AAEA;AACA,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA,YAAY,WAAW,WAAW,aAAa,KAAK,cAAc;AAClE,IAAI,sCAAsC,KAAK,eAAe;AAC9D;AACA;AACA;AACA;AACA;AACA,mDAAmD,cAAc;AACjE;AACA;AACA;AACA,YAAY,WAAW,KAAK,cAAc,aAAa,aAAa;AACpE,IAAI,sCAAsC,eAAe;AACzD;AACA;AACA,aAAa,iBAAiB;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,mDAAmD,cAAc;AACjE;AACA;AACA;AACA,YAAY,WAAW,KAAK,cAAc,aAAa,aAAa;AACpE,IAAI,sCAAsC,KAAK,eAAe;AAC9D;AACA;AACA,aAAa,iBAAiB;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,8CAA8C,cAAc;AAC5D;AACA;AACA,YAAY,WAAW,qBAAqB,cAAc;AAC1D,sBAAsB;AACtB;AACA;AACA;AACA,aAAa,iBAAiB;AAC9B;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,IAAI,cAAc;AAClB,IAAI,8BAA8B;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA,+DAA+D;AAC/D,OAAO,cAAc;AACrB;AACA;AACA,mDAAmD;AACnD;AACA;AACA;AACA,iCAAiC,cAAc,EAAE;AACjD;AACA;;AAEA;AACA;AACA,2BAA2B,QAAQ,KAAK,cAAc;AACtD;AACA;AACA,gBAAgB,yBAAyB;AACzC;AACA;;AAEA;AACA;AACA,+CAA+C,+CAA+C;AAC9F,oDAAoD;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;;AAEA;AACA;AACA,kBAAkB,QAAQ,KAAK,cAAc;AAC7C;AACA;AACA,UAAU,6BAA6B,QAAQ;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA,gBAAgB,gBAAgB;AAChC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,iBAAiB;AAC9B;AACA;AACA;AACA;AACA,SAAS,2BAA2B;AACpC;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC9iBA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,mBAAmB,aAAa,wBAAwB,aAAa;AACrE;AACA,0BAA0B,UAAU,GAAG,SAAS,OAAO,gBAAgB;AACvE,KAAK,sBAAsB;AAC3B;;AAEA,UAAU,mBAAO,CAAC,kDAAY;AAC9B,WAAW,mBAAO,CAAC,kDAAY;;AAE/B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,aAAa,kCAAkC,WAAW;AAClE;AACA,QAAQ,WAAW,kCAAkC,YAAY;AACjE;AACA,QAAQ,WAAW;AACnB;AACA,cAAc,WAAW,EAAE,sBAAsB;AACjD;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,6EAA6E;AAC7E;AACA;;AAEA;AACA;;AAEA,eAAe,sBAAsB;AACrC,2BAA2B,OAAO,KAAK,EAAE;AACzC;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,EAAE;AACF;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;;AAEA;AACA,UAAU,8CAA8C;AACxD;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,EAAE;AACF;AACA,EAAE;AACF;AACA;AACA;;AAEA;AACA,UAAU,0BAA0B;AACpC;;;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,EAAE;AACF;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,EAAE;AACF;AACA,EAAE;AACF;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,EAAE;AACF;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,EAAE;AACF;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,EAAE;AACF;AACA,EAAE;AACF;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;;AAEA;AACA;AACA;;;;;;;;;;;;ACnZA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,YAAY,mBAAO,CAAC,kDAAY;AAChC,eAAe,mBAAO,CAAC,8DAAkB;AACzC,kBAAkB,mBAAO,CAAC,8DAAkB;AAC5C,gBAAgB,mBAAO,CAAC,uEAAmB;AAC3C,0BAA0B,mBAAO,CAAC,uEAAmB;;AAErD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,WAAW,oBAAoB;AACxD;AACA;AACA,mBAAmB;AACnB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,qBAAqB,sCAAsC;AAC3D;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,+BAA+B;AAC/B;AACA,mCAAmC;AACnC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,yCAAyC;AACzC;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,8EAA8E;AAC9E;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kE;;;;;;;;;;;AC3TA;AACA;AACA;AACA;;AAEA,cAAc,mBAAO,CAAC,+CAAO;AAC7B,0BAA0B,mBAAO,CAAC,uEAAmB;AACrD,4BAA4B,mBAAO,CAAC,2EAAqB;AACzD,6BAA6B,mBAAO,CAAC,6EAAsB;AAC3D,yBAAyB,mBAAO,CAAC,qEAAkB;;;;;;;;;;;;ACTnD;AACA;AACA;AACA;AACA;;AAEA,UAAU,mBAAO,CAAC,gDAAU;AAC5B,eAAe,mBAAO,CAAC,yDAAY;AACnC,yBAAyB,mBAAO,CAAC,8DAAiB;AAClD,mBAAmB,mBAAO,CAAC,wEAAuB;AAClD,oBAAoB,mBAAO,CAAC,mEAAiB;AAC7C,yBAAyB,mBAAO,CAAC,mEAAiB;;;;AAIlD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,UAAU;AAC5C,MAAM,UAAU;AAChB;AACA;AACA,KAAK,WAAW,0CAA0C;AAC1D,KAAK,YAAY,iCAAiC,wBAAwB;AAC1E,KAAK,yBAAyB;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAI,WAAW;AACf;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,eAAe;AAC3B,WAAW,oBAAoB,KAAK,YAAY;AAChD,IAAI,WAAW,YAAY,YAAY;AACvC,IAAI,eAAe,yBAAyB,sBAAsB;AAClE;AACA,YAAY,sBAAsB;AAClC;AACA;AACA,yBAAyB,WAAW,6BAA6B;AACjE,IAAI;;AAEJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACxJA;AACA;AACA;AACA;;AAEA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B;AACA;AACA;AACA,wBAAwB,IAAI;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;;;;;;;;;;;;AC7EA;AACA;AACA;AACA;AACA;AACA;;AAEA,mBAAmB,mBAAO,CAAC,wEAAuB;AAClD,YAAY,mBAAO,CAAC,kDAAY;AAChC;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,oBAAoB;AACzB,KAAK,iBAAiB,UAAU,eAAe;AAC/C;AACA;AACA;AACA,oBAAoB,8BAA8B,OAAO;AACzD,kBAAkB,aAAa;AAC/B,KAAK,4BAA4B;AACjC;AACA;AACA;AACA;AACA,KAAK,kCAAkC;AACvC;AACA;AACA;AACA;AACA,KAAK,4BAA4B,KAAK,YAAY;AAClD;AACA,2CAA2C,mBAAmB;AAC9D,KAAK,8BAA8B;AACnC;AACA,kCAAkC,4BAA4B;AAC9D;AACA;AACA;AACA;AACA,iCAAiC;AACjC,0CAA0C;AAC1C;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,iBAAiB,yBAAyB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;;AAEA,QAAQ,eAAe;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,sCAAsC;AAC1C;AACA,IAAI,oBAAoB;AACxB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;;;;;ACvJA;AACA;AACA;AACA;;AAEA,cAAc,mBAAO,CAAC,+CAAO;AAC7B,wBAAwB,mBAAO,CAAC,mEAAiB;AACjD,6BAA6B,mBAAO,CAAC,mEAAiB;AACtD,yBAAyB,mBAAO,CAAC,yDAAY;;;;;;;;;;;;ACR7C;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,2BAA2B,yBAAyB;AACpD;AACA,wBAAwB,mCAAmC;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,aAAa,mBAAO,CAAC,kDAAY;AACjC,oBAAoB,mBAAO,CAAC,qEAAiB;AAC7C,eAAe,mBAAO,CAAC,8DAAkB;;AAEzC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,mBAAmB,eAAe,WAAW;AACjE,mDAAmD,cAAc;AACjE;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,0BAA0B;AAC1C;AACA;AACA,UAAU,mCAAmC;AAC7C;;AAEA,0D;;;;;;;;;;;AC9GA;AACA;AACA;AACA;AACA;;AAEA,gDAAgD,yBAAyB;AACzE;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,mCAAmC,2BAA2B;AAC9D;AACA;;AAEA;AACA,IAAI;AACJ;AACA;AACA,2CAA2C,kBAAkB;AAC7D,cAAc,WAAW,GAAG,yBAAyB,OAAO,UAAU;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,oCAAoC,kEAAkE,EAAE;AACxG;;AAEA;AACA,oCAAoC,sFAAsF,EAAE;AAC5H;;AAEA;AACA,iCAAiC,iGAAiG,EAAE;AACpI;;AAEA;AACA,iCAAiC,yFAAyF,EAAE;AAC5H;;AAEA;AACA;AACA;;;;;;;;;;;;;ACrFA;AACA;AACA;AACA;AACA;AACA;;AAEA,YAAY,mBAAO,CAAC,kDAAY;AAChC,aAAa,mBAAO,CAAC,uDAAU;AAC/B;AACA;AACA;AACA;AACA,eAAe,mBAAO,CAAC,gEAAmB;AAC1C,eAAe,mBAAO,CAAC,8DAAkB;AACzC,kBAAkB,mBAAO,CAAC,8DAAkB;;AAE5C;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;;;AAIA,0CAA0C,yBAAyB;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,+CAA+C,0BAA0B;AACzE;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,IAAI;AACJ;AACA,+CAA+C,0BAA0B;AACzE;AACA;AACA;AACA;;AAEA;AACA,IAAI;AACJ;AACA;AACA,gDAAgD;AAChD,mEAAmE;AACnE;AACA;AACA;AACA,QAAQ,2BAA2B;AACnC,IAAI,kCAAkC;AACtC,QAAQ,6BAA6B;AACrC,IAAI,4BAA4B;AAChC,QAAQ,+BAA+B;AACvC,IAAI,8BAA8B;AAClC,+BAA+B,mCAAmC;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA,0CAA0C;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,kCAAkC,+BAA+B;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,gCAAgC;AAC3C;AACA;AACA,2CAA2C,aAAa;AACxD;AACA;AACA;AACA;AACA,oCAAoC,aAAa,GAAG,aAAa;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,YAAY;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8DAA8D,EAAE;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,sBAAsB,oBAAoB;AAC1C,IAAI,2BAA2B;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA,sBAAsB,oBAAoB;AAC1C,IAAI,6BAA6B;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,sBAAsB,oBAAoB;AAC1C,IAAI,+BAA+B;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,gCAAgC,YAAY;AAC5C;AACA,IAAI,iBAAiB;AACrB;AACA,kCAAkC,4BAA4B;AAC9D;AACA;AACA;AACA;AACA,6CAA6C,4BAA4B;AACzE;AACA,IAAI,mCAAmC;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,iBAAiB;AACrC;AACA,kCAAkC,6BAA6B;AAC/D;AACA;AACA;AACA;AACA,6CAA6C,4BAA4B;AACzE;AACA,IAAI,mCAAmC;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAI,6BAA6B;AACjC;AACA;AACA;AACA,OAAO,YAAY,qCAAqC,YAAY;AACpE,sCAAsC,YAAY;AAClD;AACA,QAAQ,YAAY;AACpB;AACA,gDAAgD;AAChD,yBAAyB;AACzB;AACA;AACA;AACA,4BAA4B,YAAY;AACxC,uBAAuB,YAAY;AACnC,yBAAyB,mBAAmB;AAC5C;AACA;AACA;AACA,gDAAgD;AAChD,0BAA0B;AAC1B;AACA;AACA;AACA,0BAA0B,YAAY,yBAAyB,UAAU;AACzE,+CAA+C,WAAW;AAC1D;AACA;AACA;AACA,cAAc,YAAY;AAC1B;AACA;AACA,uCAAuC,UAAU;AACjD;AACA;AACA;AACA,QAAQ,kCAAkC;AAC1C;AACA;AACA;AACA,yBAAyB,UAAU,yBAAyB,QAAQ,EAAE;AACtE,SAAS,sBAAsB,4BAA4B,eAAe;AAC1E,gDAAgD,UAAU;AAC1D,YAAY,WAAW,qCAAqC,UAAU;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;;AAEA;AACA;AACA,8BAA8B,sBAAsB;AACpD;AACA,mBAAmB,WAAW,GAAG,iBAAiB;AAClD;AACA;AACA;AACA,oBAAoB,YAAY;AAChC,2BAA2B,YAAY;AACvC,IAAI,WAAW;AACf;AACA;AACA;AACA,YAAY,WAAW;AACvB,yDAAyD;AACzD;AACA;AACA;AACA;AACA,qDAAqD;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA,8BAA8B,sBAAsB;AACpD;AACA;AACA,IAAI,iBAAiB;AACrB;AACA;AACA;AACA,IAAI,4BAA4B;AAChC,IAAI,sBAAsB;AAC1B,qBAAqB,oBAAoB;AACzC;AACA;AACA;AACA,qCAAqC,YAAY;AACjD;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA,qCAAqC;AACrC;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,sBAAsB,OAAO;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C;AAC9C;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,2CAA2C;AAC3C;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,QAAQ;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,2BAA2B,yBAAyB;AACpD;AACA,IAAI,iCAAiC;AACrC,IAAI,mCAAmC;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,8BAA8B;AACpD;AACA;AACA;AACA,QAAQ,wBAAwB;AAChC;AACA;AACA;AACA;AACA,IAAI,yDAAyD;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,yCAAyC,QAAQ;AACjD,SAAS,iCAAiC;AAC1C,+BAA+B,4BAA4B;AAC3D,aAAa,2BAA2B;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,gDAAgD;AAChD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;;;;;ACnvBA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,0BAA0B,mBAAO,CAAC,oEAAqB;;AAEvD;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,YAAY;AAChC,iEAAiE;AACjE;AACA;AACA;AACA,sBAAsB,2BAA2B;AACjD,QAAQ,gCAAgC;AACxC,QAAQ,oBAAoB;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,wBAAwB,WAAW;AACnC;AACA;AACA,yBAAyB,WAAW;AACpC;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,kCAAkC,oDAAoD;AACtF;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,wDAAwD;AAC1F;AACA;AACA;AACA,2CAA2C;AAC3C;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,kCAAkC,0FAA0F;AAC5H;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,kCAAkC;AAClC,gFAAgF;AAChF;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL,mCAAmC,kBAAkB;AACrD;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACxKA;AACA;AACA;AACA;;AAEA,+BAA+B,mBAAO,CAAC,uDAAU;AACjD,+BAA+B,mBAAO,CAAC,uDAAU;AACjD,oCAAoC,mBAAO,CAAC,uDAAU;AACtD,iCAAiC,mBAAO,CAAC,uDAAU;AACnD,mCAAmC,mBAAO,CAAC,uDAAU;AACrD,kCAAkC,mBAAO,CAAC,yFAA2B;AACrE,4BAA4B,mBAAO,CAAC,qEAAiB;AACrD,wBAAwB,mBAAO,CAAC,qEAAiB;;;;;;;;;;;;ACZjD;AACA;AACA;AACA;AACA,cAAc,mBAAO,CAAC,uDAAa;AACnC,sBAAsB,mBAAO,CAAC,+EAAyB;AACvD,cAAc,mBAAO,CAAC,uDAAa;AACnC,wBAAwB,mBAAO,CAAC,mFAA2B;AAC3D,eAAe,mBAAO,CAAC,yDAAc;AACrC,gBAAgB,mBAAO,CAAC,2DAAe;AACvC,gBAAgB,mBAAO,CAAC,+CAAS;AACjC,sBAAsB,mBAAO,CAAC,2DAAe;AAC7C,sBAAsB,mBAAO,CAAC,+CAAS;AACvC,sBAAsB,mBAAO,CAAC,2DAAe;AAC7C,qBAAqB,mBAAO,CAAC,yDAAc;AAC3C,4BAA4B,mBAAO,CAAC,uEAAqB;AACzD,gBAAgB,mBAAO,CAAC,+CAAS;AACjC,iBAAiB,mBAAO,CAAC,iDAAU;AACnC,SAAS,mBAAO,CAAC,uEAAqB;AACtC;AACA,4BAA4B,mBAAO,CAAC,uEAAqB;AACzD,mBAAmB,mBAAO,CAAC,2DAAe;AAC1C,gBAAgB,mBAAO,CAAC,+CAAS;;;;;;;;;;;;ACtBjC;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ,GAAG;AACH;AACA;AACA,EAAE;AACF;;;;;;;;;;;;ACrDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA,KAAK,OAAO,sBAAsB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ,GAAG;AACH;AACA;AACA,EAAE;AACF;;;;;;;;;;;;AC7DA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,YAAY,mBAAO,CAAC,kDAAY;AAChC,eAAe,mBAAO,CAAC,8DAAkB;AACzC;AACA,YAAY,mBAAO,CAAC,mDAAa;;;AAGjC;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT,EAAE;AACF;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,EAAE;AACF;AACA,iBAAiB,uBAAuB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,wCAAwC;AAC5C,IAAI,kBAAkB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACjOA;AACA;AACA;AACA;;AAEA,YAAY,mBAAO,CAAC,kDAAY;AAChC,YAAY,mBAAO,CAAC,kDAAY;AAChC,eAAe,mBAAO,CAAC,kDAAQ;AAC/B,gBAAgB,mBAAO,CAAC,kDAAQ;AAChC,mBAAmB,mBAAO,CAAC,kDAAQ;AACnC,wBAAwB,mBAAO,CAAC,0EAAwB;AACxD,kBAAkB,mBAAO,CAAC,8DAAkB;AAC5C,yBAAyB,mBAAO,CAAC,sDAAc;;;AAG/C;AACA;AACA;;AAEA,yCAAyC,oBAAoB;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,IAAI;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,aAAa,oBAAoB;AACjC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA,aAAa,oBAAoB;AACjC;AACA;AACA;;AAEA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;;AAGA,sB;;;;;;;;;;;AC3IA;AACA;AACA;AACA;;AAEA,WAAW,mBAAO,CAAC,kDAAQ;AAC3B,gBAAgB,mBAAO,CAAC,oDAAS;AACjC;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;ACVA;AACA;AACA,aAAa,mBAAO,CAAC,oDAAc;;;AAGnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,0BAA0B,0BAA0B;AACvE;AACA,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D;AAC3D;AACA;AACA;AACA;;;AAGA;;AAEA,mEAAmE,sCAAsC,EAAE;;AAE3G;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA,oEAAoE;AACpE;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;;;AAIA;;;;;;;;;;;;;ACzIA;AACA;AACA,aAAa,mBAAO,CAAC,oDAAc;;AAEnC;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;;;;AAIA,wC;;;;;;;;;;;AC9JA;AACA;AACA,aAAa,mBAAO,CAAC,oDAAc;AACnC,qBAAqB,mBAAO,CAAC,gEAAkB;AAC/C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,0BAA0B;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,gDAAgD;AACnE,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qEAAqE;AACrE,mDAAmD;AACnD;AACA;AACA;;;AAGA;;AAEA,mEAAmE,sCAAsC,EAAE;;AAE3G;;AAEA;AACA,+BAA+B;;AAE/B;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;;AAKA;;AAEA;;AAEA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,wB;AACA;AACA;AACA;AACA;AACA;AACA,4B;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;;AAKA;;AAEA;;AAEA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;;AAKA;;AAEA;;AAEA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,wB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4B;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;;AAKA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;;AAKA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;;AAKA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;;AAKA;;AAEA;;AAEA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA,wB;AACA;AACA;AACA;AACA;AACA;AACA,4B;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;;AAKA;;AAEA;;AAEA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;AACL;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;;AAKA;;AAEA;;AAEA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,wB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yB;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;;AAKA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,wB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,0B;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;;AAKA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;;AAKA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;;AAKA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;;AAKA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;;AAKA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;;AAKA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;;AAGA;;;;;;;;;;;;AC1gDA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA,6CAA6C,kCAAkC;AAC/E;;AAEA,gBAAgB,mBAAO,CAAC,oDAAc;AACtC,qBAAqB,mBAAO,CAAC,0DAAe;AAC5C,sBAAsB,mBAAO,CAAC,4DAAgB;AAC9C,wBAAwB,mBAAO,CAAC,gEAAkB;;AAElD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,cAAc;AACd;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,0HAA0H;AAC1H,0HAA0H;;AAE1H;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,oDAAoD;AACpD;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0EAA0E;;AAE1E;AACA;AACA;AACA;AACA;AACA,oFAAoF;;AAEpF;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,sCAAsC;AACtC;AACA,OAAO;AACP;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,wBAAwB,uBAAuB;AAC/C;;AAEA;;AAEA;AACA,2BAA2B,OAAO;AAClC;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;;AAEA,kEAAkE;AAClE;AACA,yDAAyD;AACzD;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,CAAC,I","file":"antlr.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 2);\n","//\n/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n\n// This implementation of {@link TokenStream} loads tokens from a\n// {@link TokenSource} on-demand, and places the tokens in a buffer to provide\n// access to any previous token by index.\n//\n// <p>\n// This token stream ignores the value of {@link Token//getChannel}. If your\n// parser requires the token stream filter tokens to only those on a particular\n// channel, such as {@link Token//DEFAULT_CHANNEL} or\n// {@link Token//HIDDEN_CHANNEL}, use a filtering token stream such a\n// {@link CommonTokenStream}.</p>\n\nvar Token = require('./Token').Token;\nvar Lexer = require('./Lexer').Lexer;\nvar Interval = require('./IntervalSet').Interval;\n\n// this is just to keep meaningful parameter types to Parser\nfunction TokenStream() {\n\treturn this;\n}\n\nfunction BufferedTokenStream(tokenSource) {\n\n\tTokenStream.call(this);\n\t// The {@link TokenSource} from which tokens for this stream are fetched.\n\tthis.tokenSource = tokenSource;\n\n\t// A collection of all tokens fetched from the token source. The list is\n\t// considered a complete view of the input once {@link //fetchedEOF} is set\n\t// to {@code true}.\n\tthis.tokens = [];\n\n\t// The index into {@link //tokens} of the current token (next token to\n\t// {@link //consume}). {@link //tokens}{@code [}{@link //p}{@code ]} should\n\t// be\n\t// {@link //LT LT(1)}.\n\t//\n\t// <p>This field is set to -1 when the stream is first constructed or when\n\t// {@link //setTokenSource} is called, indicating that the first token has\n\t// not yet been fetched from the token source. For additional information,\n\t// see the documentation of {@link IntStream} for a description of\n\t// Initializing Methods.</p>\n\tthis.index = -1;\n\n\t// Indicates whether the {@link Token//EOF} token has been fetched from\n\t// {@link //tokenSource} and added to {@link //tokens}. This field improves\n\t// performance for the following cases:\n\t//\n\t// <ul>\n\t// <li>{@link //consume}: The lookahead check in {@link //consume} to\n\t// prevent\n\t// consuming the EOF symbol is optimized by checking the values of\n\t// {@link //fetchedEOF} and {@link //p} instead of calling {@link\n\t// //LA}.</li>\n\t// <li>{@link //fetch}: The check to prevent adding multiple EOF symbols\n\t// into\n\t// {@link //tokens} is trivial with this field.</li>\n\t// <ul>\n\tthis.fetchedEOF = false;\n\treturn this;\n}\n\nBufferedTokenStream.prototype = Object.create(TokenStream.prototype);\nBufferedTokenStream.prototype.constructor = BufferedTokenStream;\n\nBufferedTokenStream.prototype.mark = function() {\n\treturn 0;\n};\n\nBufferedTokenStream.prototype.release = function(marker) {\n\t// no resources to release\n};\n\nBufferedTokenStream.prototype.reset = function() {\n\tthis.seek(0);\n};\n\nBufferedTokenStream.prototype.seek = function(index) {\n\tthis.lazyInit();\n\tthis.index = this.adjustSeekIndex(index);\n};\n\nBufferedTokenStream.prototype.get = function(index) {\n\tthis.lazyInit();\n\treturn this.tokens[index];\n};\n\nBufferedTokenStream.prototype.consume = function() {\n\tvar skipEofCheck = false;\n\tif (this.index >= 0) {\n\t\tif (this.fetchedEOF) {\n\t\t\t// the last token in tokens is EOF. skip check if p indexes any\n\t\t\t// fetched token except the last.\n\t\t\tskipEofCheck = this.index < this.tokens.length - 1;\n\t\t} else {\n\t\t\t// no EOF token in tokens. skip check if p indexes a fetched token.\n\t\t\tskipEofCheck = this.index < this.tokens.length;\n\t\t}\n\t} else {\n\t\t// not yet initialized\n\t\tskipEofCheck = false;\n\t}\n\tif (!skipEofCheck && this.LA(1) === Token.EOF) {\n\t\tthrow \"cannot consume EOF\";\n\t}\n\tif (this.sync(this.index + 1)) {\n\t\tthis.index = this.adjustSeekIndex(this.index + 1);\n\t}\n};\n\n// Make sure index {@code i} in tokens has a token.\n//\n// @return {@code true} if a token is located at index {@code i}, otherwise\n// {@code false}.\n// @see //get(int i)\n// /\nBufferedTokenStream.prototype.sync = function(i) {\n\tvar n = i - this.tokens.length + 1; // how many more elements we need?\n\tif (n > 0) {\n\t\tvar fetched = this.fetch(n);\n\t\treturn fetched >= n;\n\t}\n\treturn true;\n};\n\n// Add {@code n} elements to buffer.\n//\n// @return The actual number of elements added to the buffer.\n// /\nBufferedTokenStream.prototype.fetch = function(n) {\n\tif (this.fetchedEOF) {\n\t\treturn 0;\n\t}\n\tfor (var i = 0; i < n; i++) {\n\t\tvar t = this.tokenSource.nextToken();\n\t\tt.tokenIndex = this.tokens.length;\n\t\tthis.tokens.push(t);\n\t\tif (t.type === Token.EOF) {\n\t\t\tthis.fetchedEOF = true;\n\t\t\treturn i + 1;\n\t\t}\n\t}\n\treturn n;\n};\n\n// Get all tokens from start..stop inclusively///\nBufferedTokenStream.prototype.getTokens = function(start, stop, types) {\n\tif (types === undefined) {\n\t\ttypes = null;\n\t}\n\tif (start < 0 || stop < 0) {\n\t\treturn null;\n\t}\n\tthis.lazyInit();\n\tvar subset = [];\n\tif (stop >= this.tokens.length) {\n\t\tstop = this.tokens.length - 1;\n\t}\n\tfor (var i = start; i < stop; i++) {\n\t\tvar t = this.tokens[i];\n\t\tif (t.type === Token.EOF) {\n\t\t\tbreak;\n\t\t}\n\t\tif (types === null || types.contains(t.type)) {\n\t\t\tsubset.push(t);\n\t\t}\n\t}\n\treturn subset;\n};\n\nBufferedTokenStream.prototype.LA = function(i) {\n\treturn this.LT(i).type;\n};\n\nBufferedTokenStream.prototype.LB = function(k) {\n\tif (this.index - k < 0) {\n\t\treturn null;\n\t}\n\treturn this.tokens[this.index - k];\n};\n\nBufferedTokenStream.prototype.LT = function(k) {\n\tthis.lazyInit();\n\tif (k === 0) {\n\t\treturn null;\n\t}\n\tif (k < 0) {\n\t\treturn this.LB(-k);\n\t}\n\tvar i = this.index + k - 1;\n\tthis.sync(i);\n\tif (i >= this.tokens.length) { // return EOF token\n\t\t// EOF must be last token\n\t\treturn this.tokens[this.tokens.length - 1];\n\t}\n\treturn this.tokens[i];\n};\n\n// Allowed derived classes to modify the behavior of operations which change\n// the current stream position by adjusting the target token index of a seek\n// operation. The default implementation simply returns {@code i}. If an\n// exception is thrown in this method, the current stream index should not be\n// changed.\n//\n// <p>For example, {@link CommonTokenStream} overrides this method to ensure\n// that\n// the seek target is always an on-channel token.</p>\n//\n// @param i The target token index.\n// @return The adjusted target token index.\n\nBufferedTokenStream.prototype.adjustSeekIndex = function(i) {\n\treturn i;\n};\n\nBufferedTokenStream.prototype.lazyInit = function() {\n\tif (this.index === -1) {\n\t\tthis.setup();\n\t}\n};\n\nBufferedTokenStream.prototype.setup = function() {\n\tthis.sync(0);\n\tthis.index = this.adjustSeekIndex(0);\n};\n\n// Reset this token stream by setting its token source.///\nBufferedTokenStream.prototype.setTokenSource = function(tokenSource) {\n\tthis.tokenSource = tokenSource;\n\tthis.tokens = [];\n\tthis.index = -1;\n\tthis.fetchedEOF = false;\n};\n\n\n// Given a starting index, return the index of the next token on channel.\n// Return i if tokens[i] is on channel. Return -1 if there are no tokens\n// on channel between i and EOF.\n// /\nBufferedTokenStream.prototype.nextTokenOnChannel = function(i, channel) {\n\tthis.sync(i);\n\tif (i >= this.tokens.length) {\n\t\treturn -1;\n\t}\n\tvar token = this.tokens[i];\n\twhile (token.channel !== this.channel) {\n\t\tif (token.type === Token.EOF) {\n\t\t\treturn -1;\n\t\t}\n\t\ti += 1;\n\t\tthis.sync(i);\n\t\ttoken = this.tokens[i];\n\t}\n\treturn i;\n};\n\n// Given a starting index, return the index of the previous token on channel.\n// Return i if tokens[i] is on channel. Return -1 if there are no tokens\n// on channel between i and 0.\nBufferedTokenStream.prototype.previousTokenOnChannel = function(i, channel) {\n\twhile (i >= 0 && this.tokens[i].channel !== channel) {\n\t\ti -= 1;\n\t}\n\treturn i;\n};\n\n// Collect all tokens on specified channel to the right of\n// the current token up until we see a token on DEFAULT_TOKEN_CHANNEL or\n// EOF. If channel is -1, find any non default channel token.\nBufferedTokenStream.prototype.getHiddenTokensToRight = function(tokenIndex,\n\t\tchannel) {\n\tif (channel === undefined) {\n\t\tchannel = -1;\n\t}\n\tthis.lazyInit();\n\tif (tokenIndex < 0 || tokenIndex >= this.tokens.length) {\n\t\tthrow \"\" + tokenIndex + \" not in 0..\" + this.tokens.length - 1;\n\t}\n\tvar nextOnChannel = this.nextTokenOnChannel(tokenIndex + 1, Lexer.DEFAULT_TOKEN_CHANNEL);\n\tvar from_ = tokenIndex + 1;\n\t// if none onchannel to right, nextOnChannel=-1 so set to = last token\n\tvar to = nextOnChannel === -1 ? this.tokens.length - 1 : nextOnChannel;\n\treturn this.filterForChannel(from_, to, channel);\n};\n\n// Collect all tokens on specified channel to the left of\n// the current token up until we see a token on DEFAULT_TOKEN_CHANNEL.\n// If channel is -1, find any non default channel token.\nBufferedTokenStream.prototype.getHiddenTokensToLeft = function(tokenIndex,\n\t\tchannel) {\n\tif (channel === undefined) {\n\t\tchannel = -1;\n\t}\n\tthis.lazyInit();\n\tif (tokenIndex < 0 || tokenIndex >= this.tokens.length) {\n\t\tthrow \"\" + tokenIndex + \" not in 0..\" + this.tokens.length - 1;\n\t}\n\tvar prevOnChannel = this.previousTokenOnChannel(tokenIndex - 1, Lexer.DEFAULT_TOKEN_CHANNEL);\n\tif (prevOnChannel === tokenIndex - 1) {\n\t\treturn null;\n\t}\n\t// if none on channel to left, prevOnChannel=-1 then from=0\n\tvar from_ = prevOnChannel + 1;\n\tvar to = tokenIndex - 1;\n\treturn this.filterForChannel(from_, to, channel);\n};\n\nBufferedTokenStream.prototype.filterForChannel = function(left, right, channel) {\n\tvar hidden = [];\n\tfor (var i = left; i < right + 1; i++) {\n\t\tvar t = this.tokens[i];\n\t\tif (channel === -1) {\n\t\t\tif (t.channel !== Lexer.DEFAULT_TOKEN_CHANNEL) {\n\t\t\t\thidden.push(t);\n\t\t\t}\n\t\t} else if (t.channel === channel) {\n\t\t\thidden.push(t);\n\t\t}\n\t}\n\tif (hidden.length === 0) {\n\t\treturn null;\n\t}\n\treturn hidden;\n};\n\nBufferedTokenStream.prototype.getSourceName = function() {\n\treturn this.tokenSource.getSourceName();\n};\n\n// Get the text of all tokens in this buffer.///\nBufferedTokenStream.prototype.getText = function(interval) {\n\tthis.lazyInit();\n\tthis.fill();\n\tif (interval === undefined || interval === null) {\n\t\tinterval = new Interval(0, this.tokens.length - 1);\n\t}\n\tvar start = interval.start;\n\tif (start instanceof Token) {\n\t\tstart = start.tokenIndex;\n\t}\n\tvar stop = interval.stop;\n\tif (stop instanceof Token) {\n\t\tstop = stop.tokenIndex;\n\t}\n\tif (start === null || stop === null || start < 0 || stop < 0) {\n\t\treturn \"\";\n\t}\n\tif (stop >= this.tokens.length) {\n\t\tstop = this.tokens.length - 1;\n\t}\n\tvar s = \"\";\n\tfor (var i = start; i < stop + 1; i++) {\n\t\tvar t = this.tokens[i];\n\t\tif (t.type === Token.EOF) {\n\t\t\tbreak;\n\t\t}\n\t\ts = s + t.text;\n\t}\n\treturn s;\n};\n\n// Get all tokens from lexer until EOF///\nBufferedTokenStream.prototype.fill = function() {\n\tthis.lazyInit();\n\twhile (this.fetch(1000) === 1000) {\n\t\tcontinue;\n\t}\n};\n\nexports.BufferedTokenStream = BufferedTokenStream;\n","//\n/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n//\n\nvar InputStream = require('./InputStream').InputStream;\n\nvar isNodeJs = typeof window === 'undefined' && typeof importScripts === 'undefined';\nvar fs = isNodeJs ? require(\"fs\") : null;\n\n// Utility functions to create InputStreams from various sources.\n//\n// All returned InputStreams support the full range of Unicode\n// up to U+10FFFF (the default behavior of InputStream only supports\n// code points up to U+FFFF).\nvar CharStreams = {\n  // Creates an InputStream from a string.\n  fromString: function(str) {\n    return new InputStream(str, true);\n  },\n\n  // Asynchronously creates an InputStream from a blob given the\n  // encoding of the bytes in that blob (defaults to 'utf8' if\n  // encoding is null).\n  //\n  // Invokes onLoad(result) on success, onError(error) on\n  // failure.\n  fromBlob: function(blob, encoding, onLoad, onError) {\n    var reader = FileReader();\n    reader.onload = function(e) {\n      var is = new InputStream(e.target.result, true);\n      onLoad(is);\n    };\n    reader.onerror = onError;\n    reader.readAsText(blob, encoding);\n  },\n\n  // Creates an InputStream from a Buffer given the\n  // encoding of the bytes in that buffer (defaults to 'utf8' if\n  // encoding is null).\n  fromBuffer: function(buffer, encoding) {\n    return new InputStream(buffer.toString(encoding), true);\n  },\n\n  // Asynchronously creates an InputStream from a file on disk given\n  // the encoding of the bytes in that file (defaults to 'utf8' if\n  // encoding is null).\n  //\n  // Invokes callback(error, result) on completion.\n  fromPath: function(path, encoding, callback) {\n    fs.readFile(path, encoding, function(err, data) {\n      var is = null;\n      if (data !== null) {\n        is = new InputStream(data, true);\n      }\n      callback(err, is);\n    });\n  },\n\n  // Synchronously creates an InputStream given a path to a file\n  // on disk and the encoding of the bytes in that file (defaults to\n  // 'utf8' if encoding is null).\n  fromPathSync: function(path, encoding) {\n    var data = fs.readFileSync(path, encoding);\n    return new InputStream(data, true);\n  }\n};\n\nexports.CharStreams = CharStreams;\n","//\n/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n//\n\n//\n// This default implementation of {@link TokenFactory} creates\n// {@link CommonToken} objects.\n//\n\nvar CommonToken = require('./Token').CommonToken;\n\nfunction TokenFactory() {\n\treturn this;\n}\n\nfunction CommonTokenFactory(copyText) {\n\tTokenFactory.call(this);\n    // Indicates whether {@link CommonToken//setText} should be called after\n    // constructing tokens to explicitly set the text. This is useful for cases\n    // where the input stream might not be able to provide arbitrary substrings\n    // of text from the input after the lexer creates a token (e.g. the\n    // implementation of {@link CharStream//getText} in\n    // {@link UnbufferedCharStream} throws an\n    // {@link UnsupportedOperationException}). Explicitly setting the token text\n    // allows {@link Token//getText} to be called at any time regardless of the\n    // input stream implementation.\n    //\n    // <p>\n    // The default value is {@code false} to avoid the performance and memory\n    // overhead of copying text for every token unless explicitly requested.</p>\n    //\n    this.copyText = copyText===undefined ? false : copyText;\n\treturn this;\n}\n\nCommonTokenFactory.prototype = Object.create(TokenFactory.prototype);\nCommonTokenFactory.prototype.constructor = CommonTokenFactory;\n\n//\n// The default {@link CommonTokenFactory} instance.\n//\n// <p>\n// This token factory does not explicitly copy token text when constructing\n// tokens.</p>\n//\nCommonTokenFactory.DEFAULT = new CommonTokenFactory();\n\nCommonTokenFactory.prototype.create = function(source, type, text, channel, start, stop, line, column) {\n    var t = new CommonToken(source, type, channel, start, stop);\n    t.line = line;\n    t.column = column;\n    if (text !==null) {\n        t.text = text;\n    } else if (this.copyText && source[1] !==null) {\n        t.text = source[1].getText(start,stop);\n    }\n    return t;\n};\n\nCommonTokenFactory.prototype.createThin = function(type, text) {\n    var t = new CommonToken(null, type);\n    t.text = text;\n    return t;\n};\n\nexports.CommonTokenFactory = CommonTokenFactory;\n","//\n/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n///\n\n//\n// This class extends {@link BufferedTokenStream} with functionality to filter\n// token streams to tokens on a particular channel (tokens where\n// {@link Token//getChannel} returns a particular value).\n//\n// <p>\n// This token stream provides access to all tokens by index or when calling\n// methods like {@link //getText}. The channel filtering is only used for code\n// accessing tokens via the lookahead methods {@link //LA}, {@link //LT}, and\n// {@link //LB}.</p>\n//\n// <p>\n// By default, tokens are placed on the default channel\n// ({@link Token//DEFAULT_CHANNEL}), but may be reassigned by using the\n// {@code ->channel(HIDDEN)} lexer command, or by using an embedded action to\n// call {@link Lexer//setChannel}.\n// </p>\n//\n// <p>\n// Note: lexer rules which use the {@code ->skip} lexer command or call\n// {@link Lexer//skip} do not produce tokens at all, so input text matched by\n// such a rule will not be available as part of the token stream, regardless of\n// channel.</p>\n///\n\nvar Token = require('./Token').Token;\nvar BufferedTokenStream = require('./BufferedTokenStream').BufferedTokenStream;\n\nfunction CommonTokenStream(lexer, channel) {\n\tBufferedTokenStream.call(this, lexer);\n    this.channel = channel===undefined ? Token.DEFAULT_CHANNEL : channel;\n    return this;\n}\n\nCommonTokenStream.prototype = Object.create(BufferedTokenStream.prototype);\nCommonTokenStream.prototype.constructor = CommonTokenStream;\n\nCommonTokenStream.prototype.adjustSeekIndex = function(i) {\n    return this.nextTokenOnChannel(i, this.channel);\n};\n\nCommonTokenStream.prototype.LB = function(k) {\n    if (k===0 || this.index-k<0) {\n        return null;\n    }\n    var i = this.index;\n    var n = 1;\n    // find k good tokens looking backwards\n    while (n <= k) {\n        // skip off-channel tokens\n        i = this.previousTokenOnChannel(i - 1, this.channel);\n        n += 1;\n    }\n    if (i < 0) {\n        return null;\n    }\n    return this.tokens[i];\n};\n\nCommonTokenStream.prototype.LT = function(k) {\n    this.lazyInit();\n    if (k === 0) {\n        return null;\n    }\n    if (k < 0) {\n        return this.LB(-k);\n    }\n    var i = this.index;\n    var n = 1; // we know tokens[pos] is a good one\n    // find k good tokens\n    while (n < k) {\n        // skip off-channel tokens, but make sure to not look past EOF\n        if (this.sync(i + 1)) {\n            i = this.nextTokenOnChannel(i + 1, this.channel);\n        }\n        n += 1;\n    }\n    return this.tokens[i];\n};\n\n// Count EOF just once.///\nCommonTokenStream.prototype.getNumberOfOnChannelTokens = function() {\n    var n = 0;\n    this.fill();\n    for (var i =0; i< this.tokens.length;i++) {\n        var t = this.tokens[i];\n        if( t.channel===this.channel) {\n            n += 1;\n        }\n        if( t.type===Token.EOF) {\n            break;\n        }\n    }\n    return n;\n};\n\nexports.CommonTokenStream = CommonTokenStream;","//\n/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n//\n\n//\n//  This is an InputStream that is loaded from a file all at once\n//  when you construct the object.\n//\nvar InputStream = require('./InputStream').InputStream;\nvar isNodeJs = typeof window === 'undefined' && typeof importScripts === 'undefined';\nvar fs = isNodeJs ? require(\"fs\") : null;\n\nfunction FileStream(fileName, decodeToUnicodeCodePoints) {\n\tvar data = fs.readFileSync(fileName, \"utf8\");\n\tInputStream.call(this, data, decodeToUnicodeCodePoints);\n\tthis.fileName = fileName;\n\treturn this;\n}\n\nFileStream.prototype = Object.create(InputStream.prototype);\nFileStream.prototype.constructor = FileStream;\n\nexports.FileStream = FileStream;\n","//\n/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n//\n\nvar Token = require('./Token').Token;\nrequire('./polyfills/codepointat');\nrequire('./polyfills/fromcodepoint');\n\n// Vacuum all input from a string and then treat it like a buffer.\n\nfunction _loadString(stream, decodeToUnicodeCodePoints) {\n\tstream._index = 0;\n\tstream.data = [];\n\tif (stream.decodeToUnicodeCodePoints) {\n\t\tfor (var i = 0; i < stream.strdata.length; ) {\n\t\t\tvar codePoint = stream.strdata.codePointAt(i);\n\t\t\tstream.data.push(codePoint);\n\t\t\ti += codePoint <= 0xFFFF ? 1 : 2;\n\t\t}\n\t} else {\n\t\tfor (var i = 0; i < stream.strdata.length; i++) {\n\t\t\tvar codeUnit = stream.strdata.charCodeAt(i);\n\t\t\tstream.data.push(codeUnit);\n\t\t}\n\t}\n\tstream._size = stream.data.length;\n}\n\n// If decodeToUnicodeCodePoints is true, the input is treated\n// as a series of Unicode code points.\n//\n// Otherwise, the input is treated as a series of 16-bit UTF-16 code\n// units.\nfunction InputStream(data, decodeToUnicodeCodePoints) {\n\tthis.name = \"<empty>\";\n\tthis.strdata = data;\n\tthis.decodeToUnicodeCodePoints = decodeToUnicodeCodePoints || false;\n\t_loadString(this);\n\treturn this;\n}\n\nObject.defineProperty(InputStream.prototype, \"index\", {\n\tget : function() {\n\t\treturn this._index;\n\t}\n});\n\nObject.defineProperty(InputStream.prototype, \"size\", {\n\tget : function() {\n\t\treturn this._size;\n\t}\n});\n\n// Reset the stream so that it's in the same state it was\n// when the object was created *except* the data array is not\n// touched.\n//\nInputStream.prototype.reset = function() {\n\tthis._index = 0;\n};\n\nInputStream.prototype.consume = function() {\n\tif (this._index >= this._size) {\n\t\t// assert this.LA(1) == Token.EOF\n\t\tthrow (\"cannot consume EOF\");\n\t}\n\tthis._index += 1;\n};\n\nInputStream.prototype.LA = function(offset) {\n\tif (offset === 0) {\n\t\treturn 0; // undefined\n\t}\n\tif (offset < 0) {\n\t\toffset += 1; // e.g., translate LA(-1) to use offset=0\n\t}\n\tvar pos = this._index + offset - 1;\n\tif (pos < 0 || pos >= this._size) { // invalid\n\t\treturn Token.EOF;\n\t}\n\treturn this.data[pos];\n};\n\nInputStream.prototype.LT = function(offset) {\n\treturn this.LA(offset);\n};\n\n// mark/release do nothing; we have entire buffer\nInputStream.prototype.mark = function() {\n\treturn -1;\n};\n\nInputStream.prototype.release = function(marker) {\n};\n\n// consume() ahead until p==_index; can't just set p=_index as we must\n// update line and column. If we seek backwards, just set p\n//\nInputStream.prototype.seek = function(_index) {\n\tif (_index <= this._index) {\n\t\tthis._index = _index; // just jump; don't update stream state (line,\n\t\t\t\t\t\t\t\t// ...)\n\t\treturn;\n\t}\n\t// seek forward\n\tthis._index = Math.min(_index, this._size);\n};\n\nInputStream.prototype.getText = function(start, stop) {\n\tif (stop >= this._size) {\n\t\tstop = this._size - 1;\n\t}\n\tif (start >= this._size) {\n\t\treturn \"\";\n\t} else {\n\t\tif (this.decodeToUnicodeCodePoints) {\n\t\t\tvar result = \"\";\n\t\t\tfor (var i = start; i <= stop; i++) {\n\t\t\t\tresult += String.fromCodePoint(this.data[i]);\n\t\t\t}\n\t\t\treturn result;\n\t\t} else {\n\t\t\treturn this.strdata.slice(start, stop + 1);\n\t\t}\n\t}\n};\n\nInputStream.prototype.toString = function() {\n\treturn this.strdata;\n};\n\nexports.InputStream = InputStream;\n","/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n\n/*jslint smarttabs:true */\n\nvar Token = require('./Token').Token;\n\n/* stop is not included! */\nfunction Interval(start, stop) {\n\tthis.start = start;\n\tthis.stop = stop;\n\treturn this;\n}\n\nInterval.prototype.contains = function(item) {\n\treturn item >= this.start && item < this.stop;\n};\n\nInterval.prototype.toString = function() {\n\tif(this.start===this.stop-1) {\n\t\treturn this.start.toString();\n\t} else {\n\t\treturn this.start.toString() + \"..\" + (this.stop-1).toString();\n\t}\n};\n\n\nObject.defineProperty(Interval.prototype, \"length\", {\n\tget : function() {\n\t\treturn this.stop - this.start;\n\t}\n});\n\nfunction IntervalSet() {\n\tthis.intervals = null;\n\tthis.readOnly = false;\n}\n\nIntervalSet.prototype.first = function(v) {\n\tif (this.intervals === null || this.intervals.length===0) {\n\t\treturn Token.INVALID_TYPE;\n\t} else {\n\t\treturn this.intervals[0].start;\n\t}\n};\n\nIntervalSet.prototype.addOne = function(v) {\n\tthis.addInterval(new Interval(v, v + 1));\n};\n\nIntervalSet.prototype.addRange = function(l, h) {\n\tthis.addInterval(new Interval(l, h + 1));\n};\n\nIntervalSet.prototype.addInterval = function(v) {\n\tif (this.intervals === null) {\n\t\tthis.intervals = [];\n\t\tthis.intervals.push(v);\n\t} else {\n\t\t// find insert pos\n\t\tfor (var k = 0; k < this.intervals.length; k++) {\n\t\t\tvar i = this.intervals[k];\n\t\t\t// distinct range -> insert\n\t\t\tif (v.stop < i.start) {\n\t\t\t\tthis.intervals.splice(k, 0, v);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// contiguous range -> adjust\n\t\t\telse if (v.stop === i.start) {\n\t\t\t\tthis.intervals[k].start = v.start;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// overlapping range -> adjust and reduce\n\t\t\telse if (v.start <= i.stop) {\n\t\t\t\tthis.intervals[k] = new Interval(Math.min(i.start, v.start), Math.max(i.stop, v.stop));\n\t\t\t\tthis.reduce(k);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t// greater than any existing\n\t\tthis.intervals.push(v);\n\t}\n};\n\nIntervalSet.prototype.addSet = function(other) {\n\tif (other.intervals !== null) {\n\t\tfor (var k = 0; k < other.intervals.length; k++) {\n\t\t\tvar i = other.intervals[k];\n\t\t\tthis.addInterval(new Interval(i.start, i.stop));\n\t\t}\n\t}\n\treturn this;\n};\n\nIntervalSet.prototype.reduce = function(k) {\n\t// only need to reduce if k is not the last\n\tif (k < this.intervalslength - 1) {\n\t\tvar l = this.intervals[k];\n\t\tvar r = this.intervals[k + 1];\n\t\t// if r contained in l\n\t\tif (l.stop >= r.stop) {\n\t\t\tthis.intervals.pop(k + 1);\n\t\t\tthis.reduce(k);\n\t\t} else if (l.stop >= r.start) {\n\t\t\tthis.intervals[k] = new Interval(l.start, r.stop);\n\t\t\tthis.intervals.pop(k + 1);\n\t\t}\n\t}\n};\n\nIntervalSet.prototype.complement = function(start, stop) {\n    var result = new IntervalSet();\n    result.addInterval(new Interval(start,stop+1));\n    for(var i=0; i<this.intervals.length; i++) {\n        result.removeRange(this.intervals[i]);\n    }\n    return result;\n};\n\nIntervalSet.prototype.contains = function(item) {\n\tif (this.intervals === null) {\n\t\treturn false;\n\t} else {\n\t\tfor (var k = 0; k < this.intervals.length; k++) {\n\t\t\tif(this.intervals[k].contains(item)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n};\n\nObject.defineProperty(IntervalSet.prototype, \"length\", {\n\tget : function() {\n\t\tvar len = 0;\n\t\tthis.intervals.map(function(i) {len += i.length;});\n\t\treturn len;\n\t}\n});\n\nIntervalSet.prototype.removeRange = function(v) {\n    if(v.start===v.stop-1) {\n        this.removeOne(v.start);\n    } else if (this.intervals!==null) {\n        var k = 0;\n        for(var n=0; n<this.intervals.length; n++) {\n            var i = this.intervals[k];\n            // intervals are ordered\n            if (v.stop<=i.start) {\n                return;\n            }\n            // check for including range, split it\n            else if(v.start>i.start && v.stop<i.stop) {\n                this.intervals[k] = new Interval(i.start, v.start);\n                var x = new Interval(v.stop, i.stop);\n                this.intervals.splice(k, 0, x);\n                return;\n            }\n            // check for included range, remove it\n            else if(v.start<=i.start && v.stop>=i.stop) {\n                this.intervals.splice(k, 1);\n                k = k - 1; // need another pass\n            }\n            // check for lower boundary\n            else if(v.start<i.stop) {\n                this.intervals[k] = new Interval(i.start, v.start);\n            }\n            // check for upper boundary\n            else if(v.stop<i.stop) {\n                this.intervals[k] = new Interval(v.stop, i.stop);\n            }\n            k += 1;\n        }\n    }\n};\n\nIntervalSet.prototype.removeOne = function(v) {\n\tif (this.intervals !== null) {\n\t\tfor (var k = 0; k < this.intervals.length; k++) {\n\t\t\tvar i = this.intervals[k];\n\t\t\t// intervals is ordered\n\t\t\tif (v < i.start) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// check for single value range\n\t\t\telse if (v === i.start && v === i.stop - 1) {\n\t\t\t\tthis.intervals.splice(k, 1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// check for lower boundary\n\t\t\telse if (v === i.start) {\n\t\t\t\tthis.intervals[k] = new Interval(i.start + 1, i.stop);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// check for upper boundary\n\t\t\telse if (v === i.stop - 1) {\n\t\t\t\tthis.intervals[k] = new Interval(i.start, i.stop - 1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// split existing range\n\t\t\telse if (v < i.stop - 1) {\n\t\t\t\tvar x = new Interval(i.start, v);\n\t\t\t\ti.start = v + 1;\n\t\t\t\tthis.intervals.splice(k, 0, x);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}\n};\n\nIntervalSet.prototype.toString = function(literalNames, symbolicNames, elemsAreChar) {\n\tliteralNames = literalNames || null;\n\tsymbolicNames = symbolicNames || null;\n\telemsAreChar = elemsAreChar || false;\n\tif (this.intervals === null) {\n\t\treturn \"{}\";\n\t} else if(literalNames!==null || symbolicNames!==null) {\n\t\treturn this.toTokenString(literalNames, symbolicNames);\n\t} else if(elemsAreChar) {\n\t\treturn this.toCharString();\n\t} else {\n\t\treturn this.toIndexString();\n\t}\n};\n\nIntervalSet.prototype.toCharString = function() {\n\tvar names = [];\n\tfor (var i = 0; i < this.intervals.length; i++) {\n\t\tvar v = this.intervals[i];\n\t\tif(v.stop===v.start+1) {\n\t\t\tif ( v.start===Token.EOF ) {\n\t\t\t\tnames.push(\"<EOF>\");\n\t\t\t} else {\n\t\t\t\tnames.push(\"'\" + String.fromCharCode(v.start) + \"'\");\n\t\t\t}\n\t\t} else {\n\t\t\tnames.push(\"'\" + String.fromCharCode(v.start) + \"'..'\" + String.fromCharCode(v.stop-1) + \"'\");\n\t\t}\n\t}\n\tif (names.length > 1) {\n\t\treturn \"{\" + names.join(\", \") + \"}\";\n\t} else {\n\t\treturn names[0];\n\t}\n};\n\n\nIntervalSet.prototype.toIndexString = function() {\n\tvar names = [];\n\tfor (var i = 0; i < this.intervals.length; i++) {\n\t\tvar v = this.intervals[i];\n\t\tif(v.stop===v.start+1) {\n\t\t\tif ( v.start===Token.EOF ) {\n\t\t\t\tnames.push(\"<EOF>\");\n\t\t\t} else {\n\t\t\t\tnames.push(v.start.toString());\n\t\t\t}\n\t\t} else {\n\t\t\tnames.push(v.start.toString() + \"..\" + (v.stop-1).toString());\n\t\t}\n\t}\n\tif (names.length > 1) {\n\t\treturn \"{\" + names.join(\", \") + \"}\";\n\t} else {\n\t\treturn names[0];\n\t}\n};\n\n\nIntervalSet.prototype.toTokenString = function(literalNames, symbolicNames) {\n\tvar names = [];\n\tfor (var i = 0; i < this.intervals.length; i++) {\n\t\tvar v = this.intervals[i];\n\t\tfor (var j = v.start; j < v.stop; j++) {\n\t\t\tnames.push(this.elementName(literalNames, symbolicNames, j));\n\t\t}\n\t}\n\tif (names.length > 1) {\n\t\treturn \"{\" + names.join(\", \") + \"}\";\n\t} else {\n\t\treturn names[0];\n\t}\n};\n\nIntervalSet.prototype.elementName = function(literalNames, symbolicNames, a) {\n\tif (a === Token.EOF) {\n\t\treturn \"<EOF>\";\n\t} else if (a === Token.EPSILON) {\n\t\treturn \"<EPSILON>\";\n\t} else {\n\t\treturn literalNames[a] || symbolicNames[a];\n\t}\n};\n\nexports.Interval = Interval;\nexports.IntervalSet = IntervalSet;\n","//\n/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n///\n\nvar Set = require('./Utils').Set;\nvar BitSet = require('./Utils').BitSet;\nvar Token = require('./Token').Token;\nvar ATNConfig = require('./atn/ATNConfig').ATNConfig;\nvar Interval = require('./IntervalSet').Interval;\nvar IntervalSet = require('./IntervalSet').IntervalSet;\nvar RuleStopState = require('./atn/ATNState').RuleStopState;\nvar RuleTransition = require('./atn/Transition').RuleTransition;\nvar NotSetTransition = require('./atn/Transition').NotSetTransition;\nvar WildcardTransition = require('./atn/Transition').WildcardTransition;\nvar AbstractPredicateTransition = require('./atn/Transition').AbstractPredicateTransition;\n\nvar pc = require('./PredictionContext');\nvar predictionContextFromRuleContext = pc.predictionContextFromRuleContext;\nvar PredictionContext = pc.PredictionContext;\nvar SingletonPredictionContext = pc.SingletonPredictionContext;\n\nfunction LL1Analyzer (atn) {\n    this.atn = atn;\n}\n\n//* Special value added to the lookahead sets to indicate that we hit\n//  a predicate during analysis if {@code seeThruPreds==false}.\n///\nLL1Analyzer.HIT_PRED = Token.INVALID_TYPE;\n\n\n//*\n// Calculates the SLL(1) expected lookahead set for each outgoing transition\n// of an {@link ATNState}. The returned array has one element for each\n// outgoing transition in {@code s}. If the closure from transition\n// <em>i</em> leads to a semantic predicate before matching a symbol, the\n// element at index <em>i</em> of the result will be {@code null}.\n//\n// @param s the ATN state\n// @return the expected symbols for each outgoing transition of {@code s}.\n///\nLL1Analyzer.prototype.getDecisionLookahead = function(s) {\n    if (s === null) {\n        return null;\n    }\n    var count = s.transitions.length;\n    var look = [];\n    for(var alt=0; alt< count; alt++) {\n        look[alt] = new IntervalSet();\n        var lookBusy = new Set();\n        var seeThruPreds = false; // fail to get lookahead upon pred\n        this._LOOK(s.transition(alt).target, null, PredictionContext.EMPTY,\n              look[alt], lookBusy, new BitSet(), seeThruPreds, false);\n        // Wipe out lookahead for this alternative if we found nothing\n        // or we had a predicate when we !seeThruPreds\n        if (look[alt].length===0 || look[alt].contains(LL1Analyzer.HIT_PRED)) {\n            look[alt] = null;\n        }\n    }\n    return look;\n};\n\n//*\n// Compute set of tokens that can follow {@code s} in the ATN in the\n// specified {@code ctx}.\n//\n// <p>If {@code ctx} is {@code null} and the end of the rule containing\n// {@code s} is reached, {@link Token//EPSILON} is added to the result set.\n// If {@code ctx} is not {@code null} and the end of the outermost rule is\n// reached, {@link Token//EOF} is added to the result set.</p>\n//\n// @param s the ATN state\n// @param stopState the ATN state to stop at. This can be a\n// {@link BlockEndState} to detect epsilon paths through a closure.\n// @param ctx the complete parser context, or {@code null} if the context\n// should be ignored\n//\n// @return The set of tokens that can follow {@code s} in the ATN in the\n// specified {@code ctx}.\n///\nLL1Analyzer.prototype.LOOK = function(s, stopState, ctx) {\n    var r = new IntervalSet();\n    var seeThruPreds = true; // ignore preds; get all lookahead\n\tctx = ctx || null;\n    var lookContext = ctx!==null ? predictionContextFromRuleContext(s.atn, ctx) : null;\n    this._LOOK(s, stopState, lookContext, r, new Set(), new BitSet(), seeThruPreds, true);\n    return r;\n};\n\n//*\n// Compute set of tokens that can follow {@code s} in the ATN in the\n// specified {@code ctx}.\n//\n// <p>If {@code ctx} is {@code null} and {@code stopState} or the end of the\n// rule containing {@code s} is reached, {@link Token//EPSILON} is added to\n// the result set. If {@code ctx} is not {@code null} and {@code addEOF} is\n// {@code true} and {@code stopState} or the end of the outermost rule is\n// reached, {@link Token//EOF} is added to the result set.</p>\n//\n// @param s the ATN state.\n// @param stopState the ATN state to stop at. This can be a\n// {@link BlockEndState} to detect epsilon paths through a closure.\n// @param ctx The outer context, or {@code null} if the outer context should\n// not be used.\n// @param look The result lookahead set.\n// @param lookBusy A set used for preventing epsilon closures in the ATN\n// from causing a stack overflow. Outside code should pass\n// {@code new Set<ATNConfig>} for this argument.\n// @param calledRuleStack A set used for preventing left recursion in the\n// ATN from causing a stack overflow. Outside code should pass\n// {@code new BitSet()} for this argument.\n// @param seeThruPreds {@code true} to true semantic predicates as\n// implicitly {@code true} and \"see through them\", otherwise {@code false}\n// to treat semantic predicates as opaque and add {@link //HIT_PRED} to the\n// result if one is encountered.\n// @param addEOF Add {@link Token//EOF} to the result if the end of the\n// outermost context is reached. This parameter has no effect if {@code ctx}\n// is {@code null}.\n///\nLL1Analyzer.prototype._LOOK = function(s, stopState , ctx, look, lookBusy, calledRuleStack, seeThruPreds, addEOF) {\n    var c = new ATNConfig({state:s, alt:0, context: ctx}, null);\n    if (lookBusy.contains(c)) {\n        return;\n    }\n    lookBusy.add(c);\n    if (s === stopState) {\n        if (ctx ===null) {\n            look.addOne(Token.EPSILON);\n            return;\n        } else if (ctx.isEmpty() && addEOF) {\n            look.addOne(Token.EOF);\n            return;\n        }\n    }\n    if (s instanceof RuleStopState ) {\n        if (ctx ===null) {\n            look.addOne(Token.EPSILON);\n            return;\n        } else if (ctx.isEmpty() && addEOF) {\n            look.addOne(Token.EOF);\n            return;\n        }\n        if (ctx !== PredictionContext.EMPTY) {\n            // run thru all possible stack tops in ctx\n            for(var i=0; i<ctx.length; i++) {\n                var returnState = this.atn.states[ctx.getReturnState(i)];\n                var removed = calledRuleStack.contains(returnState.ruleIndex);\n                try {\n                    calledRuleStack.remove(returnState.ruleIndex);\n                    this._LOOK(returnState, stopState, ctx.getParent(i), look, lookBusy, calledRuleStack, seeThruPreds, addEOF);\n                } finally {\n                    if (removed) {\n                        calledRuleStack.add(returnState.ruleIndex);\n                    }\n                }\n            }\n            return;\n        }\n    }\n    for(var j=0; j<s.transitions.length; j++) {\n        var t = s.transitions[j];\n        if (t.constructor === RuleTransition) {\n            if (calledRuleStack.contains(t.target.ruleIndex)) {\n                continue;\n            }\n            var newContext = SingletonPredictionContext.create(ctx, t.followState.stateNumber);\n            try {\n                calledRuleStack.add(t.target.ruleIndex);\n                this._LOOK(t.target, stopState, newContext, look, lookBusy, calledRuleStack, seeThruPreds, addEOF);\n            } finally {\n                calledRuleStack.remove(t.target.ruleIndex);\n            }\n        } else if (t instanceof AbstractPredicateTransition ) {\n            if (seeThruPreds) {\n                this._LOOK(t.target, stopState, ctx, look, lookBusy, calledRuleStack, seeThruPreds, addEOF);\n            } else {\n                look.addOne(LL1Analyzer.HIT_PRED);\n            }\n        } else if( t.isEpsilon) {\n            this._LOOK(t.target, stopState, ctx, look, lookBusy, calledRuleStack, seeThruPreds, addEOF);\n        } else if (t.constructor === WildcardTransition) {\n            look.addRange( Token.MIN_USER_TOKEN_TYPE, this.atn.maxTokenType );\n        } else {\n            var set = t.label;\n            if (set !== null) {\n                if (t instanceof NotSetTransition) {\n                    set = set.complement(Token.MIN_USER_TOKEN_TYPE, this.atn.maxTokenType);\n                }\n                look.addSet(set);\n            }\n        }\n    }\n};\n\nexports.LL1Analyzer = LL1Analyzer;\n\n","/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n///\n\n// A lexer is recognizer that draws input symbols from a character stream.\n//  lexer grammars result in a subclass of this object. A Lexer object\n//  uses simplified match() and error recovery mechanisms in the interest of speed.\n\nvar Token = require('./Token').Token;\nvar Recognizer = require('./Recognizer').Recognizer;\nvar CommonTokenFactory = require('./CommonTokenFactory').CommonTokenFactory;\nvar RecognitionException  = require('./error/Errors').RecognitionException;\nvar LexerNoViableAltException = require('./error/Errors').LexerNoViableAltException;\n\nfunction TokenSource() {\n\treturn this;\n}\n\nfunction Lexer(input) {\n\tRecognizer.call(this);\n\tthis._input = input;\n\tthis._factory = CommonTokenFactory.DEFAULT;\n\tthis._tokenFactorySourcePair = [ this, input ];\n\n\tthis._interp = null; // child classes must populate this\n\n\t// The goal of all lexer rules/methods is to create a token object.\n\t// this is an instance variable as multiple rules may collaborate to\n\t// create a single token. nextToken will return this object after\n\t// matching lexer rule(s). If you subclass to allow multiple token\n\t// emissions, then set this to the last token to be matched or\n\t// something nonnull so that the auto token emit mechanism will not\n\t// emit another token.\n\tthis._token = null;\n\n\t// What character index in the stream did the current token start at?\n\t// Needed, for example, to get the text for current token. Set at\n\t// the start of nextToken.\n\tthis._tokenStartCharIndex = -1;\n\n\t// The line on which the first character of the token resides///\n\tthis._tokenStartLine = -1;\n\n\t// The character position of first character within the line///\n\tthis._tokenStartColumn = -1;\n\n\t// Once we see EOF on char stream, next token will be EOF.\n\t// If you have DONE : EOF ; then you see DONE EOF.\n\tthis._hitEOF = false;\n\n\t// The channel number for the current token///\n\tthis._channel = Token.DEFAULT_CHANNEL;\n\n\t// The token type for the current token///\n\tthis._type = Token.INVALID_TYPE;\n\n\tthis._modeStack = [];\n\tthis._mode = Lexer.DEFAULT_MODE;\n\n\t// You can set the text for the current token to override what is in\n\t// the input char buffer. Use setText() or can set this instance var.\n\t// /\n\tthis._text = null;\n\n\treturn this;\n}\n\nLexer.prototype = Object.create(Recognizer.prototype);\nLexer.prototype.constructor = Lexer;\n\nLexer.DEFAULT_MODE = 0;\nLexer.MORE = -2;\nLexer.SKIP = -3;\n\nLexer.DEFAULT_TOKEN_CHANNEL = Token.DEFAULT_CHANNEL;\nLexer.HIDDEN = Token.HIDDEN_CHANNEL;\nLexer.MIN_CHAR_VALUE = 0x0000;\nLexer.MAX_CHAR_VALUE = 0x10FFFF;\n\nLexer.prototype.reset = function() {\n\t// wack Lexer state variables\n\tif (this._input !== null) {\n\t\tthis._input.seek(0); // rewind the input\n\t}\n\tthis._token = null;\n\tthis._type = Token.INVALID_TYPE;\n\tthis._channel = Token.DEFAULT_CHANNEL;\n\tthis._tokenStartCharIndex = -1;\n\tthis._tokenStartColumn = -1;\n\tthis._tokenStartLine = -1;\n\tthis._text = null;\n\n\tthis._hitEOF = false;\n\tthis._mode = Lexer.DEFAULT_MODE;\n\tthis._modeStack = [];\n\n\tthis._interp.reset();\n};\n\n// Return a token from this source; i.e., match a token on the char stream.\nLexer.prototype.nextToken = function() {\n\tif (this._input === null) {\n\t\tthrow \"nextToken requires a non-null input stream.\";\n\t}\n\n\t// Mark start location in char stream so unbuffered streams are\n\t// guaranteed at least have text of current token\n\tvar tokenStartMarker = this._input.mark();\n\ttry {\n\t\twhile (true) {\n\t\t\tif (this._hitEOF) {\n\t\t\t\tthis.emitEOF();\n\t\t\t\treturn this._token;\n\t\t\t}\n\t\t\tthis._token = null;\n\t\t\tthis._channel = Token.DEFAULT_CHANNEL;\n\t\t\tthis._tokenStartCharIndex = this._input.index;\n\t\t\tthis._tokenStartColumn = this._interp.column;\n\t\t\tthis._tokenStartLine = this._interp.line;\n\t\t\tthis._text = null;\n\t\t\tvar continueOuter = false;\n\t\t\twhile (true) {\n\t\t\t\tthis._type = Token.INVALID_TYPE;\n\t\t\t\tvar ttype = Lexer.SKIP;\n\t\t\t\ttry {\n\t\t\t\t\tttype = this._interp.match(this._input, this._mode);\n\t\t\t\t} catch (e) {\n\t\t\t\t    if(e instanceof RecognitionException) {\n                        this.notifyListeners(e); // report error\n                        this.recover(e);\n                    } else {\n                        console.log(e.stack);\n                        throw e;\n                    }\n\t\t\t\t}\n\t\t\t\tif (this._input.LA(1) === Token.EOF) {\n\t\t\t\t\tthis._hitEOF = true;\n\t\t\t\t}\n\t\t\t\tif (this._type === Token.INVALID_TYPE) {\n\t\t\t\t\tthis._type = ttype;\n\t\t\t\t}\n\t\t\t\tif (this._type === Lexer.SKIP) {\n\t\t\t\t\tcontinueOuter = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (this._type !== Lexer.MORE) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (continueOuter) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (this._token === null) {\n\t\t\t\tthis.emit();\n\t\t\t}\n\t\t\treturn this._token;\n\t\t}\n\t} finally {\n\t\t// make sure we release marker after match or\n\t\t// unbuffered char stream will keep buffering\n\t\tthis._input.release(tokenStartMarker);\n\t}\n};\n\n// Instruct the lexer to skip creating a token for current lexer rule\n// and look for another token. nextToken() knows to keep looking when\n// a lexer rule finishes with token set to SKIP_TOKEN. Recall that\n// if token==null at end of any token rule, it creates one for you\n// and emits it.\n// /\nLexer.prototype.skip = function() {\n\tthis._type = Lexer.SKIP;\n};\n\nLexer.prototype.more = function() {\n\tthis._type = Lexer.MORE;\n};\n\nLexer.prototype.mode = function(m) {\n\tthis._mode = m;\n};\n\nLexer.prototype.pushMode = function(m) {\n\tif (this._interp.debug) {\n\t\tconsole.log(\"pushMode \" + m);\n\t}\n\tthis._modeStack.push(this._mode);\n\tthis.mode(m);\n};\n\nLexer.prototype.popMode = function() {\n\tif (this._modeStack.length === 0) {\n\t\tthrow \"Empty Stack\";\n\t}\n\tif (this._interp.debug) {\n\t\tconsole.log(\"popMode back to \" + this._modeStack.slice(0, -1));\n\t}\n\tthis.mode(this._modeStack.pop());\n\treturn this._mode;\n};\n\n// Set the char stream and reset the lexer\nObject.defineProperty(Lexer.prototype, \"inputStream\", {\n\tget : function() {\n\t\treturn this._input;\n\t},\n\tset : function(input) {\n\t\tthis._input = null;\n\t\tthis._tokenFactorySourcePair = [ this, this._input ];\n\t\tthis.reset();\n\t\tthis._input = input;\n\t\tthis._tokenFactorySourcePair = [ this, this._input ];\n\t}\n});\n\nObject.defineProperty(Lexer.prototype, \"sourceName\", {\n\tget : function sourceName() {\n\t\treturn this._input.sourceName;\n\t}\n});\n\n// By default does not support multiple emits per nextToken invocation\n// for efficiency reasons. Subclass and override this method, nextToken,\n// and getToken (to push tokens into a list and pull from that list\n// rather than a single variable as this implementation does).\n// /\nLexer.prototype.emitToken = function(token) {\n\tthis._token = token;\n};\n\n// The standard method called to automatically emit a token at the\n// outermost lexical rule. The token object should point into the\n// char buffer start..stop. If there is a text override in 'text',\n// use that to set the token's text. Override this method to emit\n// custom Token objects or provide a new factory.\n// /\nLexer.prototype.emit = function() {\n\tvar t = this._factory.create(this._tokenFactorySourcePair, this._type,\n\t\t\tthis._text, this._channel, this._tokenStartCharIndex, this\n\t\t\t\t\t.getCharIndex() - 1, this._tokenStartLine,\n\t\t\tthis._tokenStartColumn);\n\tthis.emitToken(t);\n\treturn t;\n};\n\nLexer.prototype.emitEOF = function() {\n\tvar cpos = this.column;\n\tvar lpos = this.line;\n\tvar eof = this._factory.create(this._tokenFactorySourcePair, Token.EOF,\n\t\t\tnull, Token.DEFAULT_CHANNEL, this._input.index,\n\t\t\tthis._input.index - 1, lpos, cpos);\n\tthis.emitToken(eof);\n\treturn eof;\n};\n\nObject.defineProperty(Lexer.prototype, \"type\", {\n\tget : function() {\n\t\treturn this.type;\n\t},\n\tset : function(type) {\n\t\tthis._type = type;\n\t}\n});\n\nObject.defineProperty(Lexer.prototype, \"line\", {\n\tget : function() {\n\t\treturn this._interp.line;\n\t},\n\tset : function(line) {\n\t\tthis._interp.line = line;\n\t}\n});\n\nObject.defineProperty(Lexer.prototype, \"column\", {\n\tget : function() {\n\t\treturn this._interp.column;\n\t},\n\tset : function(column) {\n\t\tthis._interp.column = column;\n\t}\n});\n\n\n// What is the index of the current character of lookahead?///\nLexer.prototype.getCharIndex = function() {\n\treturn this._input.index;\n};\n\n// Return the text matched so far for the current token or any text override.\n//Set the complete text of this token; it wipes any previous changes to the text.\nObject.defineProperty(Lexer.prototype, \"text\", {\n\tget : function() {\n\t\tif (this._text !== null) {\n\t\t\treturn this._text;\n\t\t} else {\n\t\t\treturn this._interp.getText(this._input);\n\t\t}\n\t},\n\tset : function(text) {\n\t\tthis._text = text;\n\t}\n});\n// Return a list of all Token objects in input char stream.\n// Forces load of all tokens. Does not include EOF token.\n// /\nLexer.prototype.getAllTokens = function() {\n\tvar tokens = [];\n\tvar t = this.nextToken();\n\twhile (t.type !== Token.EOF) {\n\t\ttokens.push(t);\n\t\tt = this.nextToken();\n\t}\n\treturn tokens;\n};\n\nLexer.prototype.notifyListeners = function(e) {\n\tvar start = this._tokenStartCharIndex;\n\tvar stop = this._input.index;\n\tvar text = this._input.getText(start, stop);\n\tvar msg = \"token recognition error at: '\" + this.getErrorDisplay(text) + \"'\";\n\tvar listener = this.getErrorListenerDispatch();\n\tlistener.syntaxError(this, null, this._tokenStartLine,\n\t\t\tthis._tokenStartColumn, msg, e);\n};\n\nLexer.prototype.getErrorDisplay = function(s) {\n\tvar d = [];\n\tfor (var i = 0; i < s.length; i++) {\n\t\td.push(s[i]);\n\t}\n\treturn d.join('');\n};\n\nLexer.prototype.getErrorDisplayForChar = function(c) {\n\tif (c.charCodeAt(0) === Token.EOF) {\n\t\treturn \"<EOF>\";\n\t} else if (c === '\\n') {\n\t\treturn \"\\\\n\";\n\t} else if (c === '\\t') {\n\t\treturn \"\\\\t\";\n\t} else if (c === '\\r') {\n\t\treturn \"\\\\r\";\n\t} else {\n\t\treturn c;\n\t}\n};\n\nLexer.prototype.getCharErrorDisplay = function(c) {\n\treturn \"'\" + this.getErrorDisplayForChar(c) + \"'\";\n};\n\n// Lexers can normally match any char in it's vocabulary after matching\n// a token, so do the easy thing and just kill a character and hope\n// it all works out. You can instead use the rule invocation stack\n// to do sophisticated error recovery if you are in a fragment rule.\n// /\nLexer.prototype.recover = function(re) {\n\tif (this._input.LA(1) !== Token.EOF) {\n\t\tif (re instanceof LexerNoViableAltException) {\n\t\t\t// skip a char and try again\n\t\t\tthis._interp.consume(this._input);\n\t\t} else {\n\t\t\t// TODO: Do we lose character or line position information?\n\t\t\tthis._input.consume();\n\t\t}\n\t}\n};\n\nexports.Lexer = Lexer;\n","/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n\nvar Token = require('./Token').Token;\nvar ParseTreeListener = require('./tree/Tree').ParseTreeListener;\nvar Recognizer = require('./Recognizer').Recognizer;\nvar DefaultErrorStrategy = require('./error/ErrorStrategy').DefaultErrorStrategy;\nvar ATNDeserializer = require('./atn/ATNDeserializer').ATNDeserializer;\nvar ATNDeserializationOptions = require('./atn/ATNDeserializationOptions').ATNDeserializationOptions;\nvar TerminalNode = require('./tree/Tree').TerminalNode;\nvar ErrorNode = require('./tree/Tree').ErrorNode;\n\nfunction TraceListener(parser) {\n\tParseTreeListener.call(this);\n    this.parser = parser;\n\treturn this;\n}\n\nTraceListener.prototype = Object.create(ParseTreeListener.prototype);\nTraceListener.prototype.constructor = TraceListener;\n\nTraceListener.prototype.enterEveryRule = function(ctx) {\n\tconsole.log(\"enter   \" + this.parser.ruleNames[ctx.ruleIndex] + \", LT(1)=\" + this.parser._input.LT(1).text);\n};\n\nTraceListener.prototype.visitTerminal = function( node) {\n\tconsole.log(\"consume \" + node.symbol + \" rule \" + this.parser.ruleNames[this.parser._ctx.ruleIndex]);\n};\n\nTraceListener.prototype.exitEveryRule = function(ctx) {\n\tconsole.log(\"exit    \" + this.parser.ruleNames[ctx.ruleIndex] + \", LT(1)=\" + this.parser._input.LT(1).text);\n};\n\n// this is all the parsing support code essentially; most of it is error\n// recovery stuff.//\nfunction Parser(input) {\n\tRecognizer.call(this);\n\t// The input stream.\n\tthis._input = null;\n\t// The error handling strategy for the parser. The default value is a new\n\t// instance of {@link DefaultErrorStrategy}.\n\tthis._errHandler = new DefaultErrorStrategy();\n\tthis._precedenceStack = [];\n\tthis._precedenceStack.push(0);\n\t// The {@link ParserRuleContext} object for the currently executing rule.\n\t// this is always non-null during the parsing process.\n\tthis._ctx = null;\n\t// Specifies whether or not the parser should construct a parse tree during\n\t// the parsing process. The default value is {@code true}.\n\tthis.buildParseTrees = true;\n\t// When {@link //setTrace}{@code (true)} is called, a reference to the\n\t// {@link TraceListener} is stored here so it can be easily removed in a\n\t// later call to {@link //setTrace}{@code (false)}. The listener itself is\n\t// implemented as a parser listener so this field is not directly used by\n\t// other parser methods.\n\tthis._tracer = null;\n\t// The list of {@link ParseTreeListener} listeners registered to receive\n\t// events during the parse.\n\tthis._parseListeners = null;\n\t// The number of syntax errors reported during parsing. this value is\n\t// incremented each time {@link //notifyErrorListeners} is called.\n\tthis._syntaxErrors = 0;\n\tthis.setInputStream(input);\n\treturn this;\n}\n\nParser.prototype = Object.create(Recognizer.prototype);\nParser.prototype.contructor = Parser;\n\n// this field maps from the serialized ATN string to the deserialized {@link\n// ATN} with\n// bypass alternatives.\n//\n// @see ATNDeserializationOptions//isGenerateRuleBypassTransitions()\n//\nParser.bypassAltsAtnCache = {};\n\n// reset the parser's state//\nParser.prototype.reset = function() {\n\tif (this._input !== null) {\n\t\tthis._input.seek(0);\n\t}\n\tthis._errHandler.reset(this);\n\tthis._ctx = null;\n\tthis._syntaxErrors = 0;\n\tthis.setTrace(false);\n\tthis._precedenceStack = [];\n\tthis._precedenceStack.push(0);\n\tif (this._interp !== null) {\n\t\tthis._interp.reset();\n\t}\n};\n\n// Match current input symbol against {@code ttype}. If the symbol type\n// matches, {@link ANTLRErrorStrategy//reportMatch} and {@link //consume} are\n// called to complete the match process.\n//\n// <p>If the symbol type does not match,\n// {@link ANTLRErrorStrategy//recoverInline} is called on the current error\n// strategy to attempt recovery. If {@link //getBuildParseTree} is\n// {@code true} and the token index of the symbol returned by\n// {@link ANTLRErrorStrategy//recoverInline} is -1, the symbol is added to\n// the parse tree by calling {@link ParserRuleContext//addErrorNode}.</p>\n//\n// @param ttype the token type to match\n// @return the matched symbol\n// @throws RecognitionException if the current input symbol did not match\n// {@code ttype} and the error strategy could not recover from the\n// mismatched symbol\n\nParser.prototype.match = function(ttype) {\n\tvar t = this.getCurrentToken();\n\tif (t.type === ttype) {\n\t\tthis._errHandler.reportMatch(this);\n\t\tthis.consume();\n\t} else {\n\t\tt = this._errHandler.recoverInline(this);\n\t\tif (this.buildParseTrees && t.tokenIndex === -1) {\n\t\t\t// we must have conjured up a new token during single token\n\t\t\t// insertion\n\t\t\t// if it's not the current symbol\n\t\t\tthis._ctx.addErrorNode(t);\n\t\t}\n\t}\n\treturn t;\n};\n// Match current input symbol as a wildcard. If the symbol type matches\n// (i.e. has a value greater than 0), {@link ANTLRErrorStrategy//reportMatch}\n// and {@link //consume} are called to complete the match process.\n//\n// <p>If the symbol type does not match,\n// {@link ANTLRErrorStrategy//recoverInline} is called on the current error\n// strategy to attempt recovery. If {@link //getBuildParseTree} is\n// {@code true} and the token index of the symbol returned by\n// {@link ANTLRErrorStrategy//recoverInline} is -1, the symbol is added to\n// the parse tree by calling {@link ParserRuleContext//addErrorNode}.</p>\n//\n// @return the matched symbol\n// @throws RecognitionException if the current input symbol did not match\n// a wildcard and the error strategy could not recover from the mismatched\n// symbol\n\nParser.prototype.matchWildcard = function() {\n\tvar t = this.getCurrentToken();\n\tif (t.type > 0) {\n\t\tthis._errHandler.reportMatch(this);\n\t\tthis.consume();\n\t} else {\n\t\tt = this._errHandler.recoverInline(this);\n\t\tif (this._buildParseTrees && t.tokenIndex === -1) {\n\t\t\t// we must have conjured up a new token during single token\n\t\t\t// insertion\n\t\t\t// if it's not the current symbol\n\t\t\tthis._ctx.addErrorNode(t);\n\t\t}\n\t}\n\treturn t;\n};\n\nParser.prototype.getParseListeners = function() {\n\treturn this._parseListeners || [];\n};\n\n// Registers {@code listener} to receive events during the parsing process.\n//\n// <p>To support output-preserving grammar transformations (including but not\n// limited to left-recursion removal, automated left-factoring, and\n// optimized code generation), calls to listener methods during the parse\n// may differ substantially from calls made by\n// {@link ParseTreeWalker//DEFAULT} used after the parse is complete. In\n// particular, rule entry and exit events may occur in a different order\n// during the parse than after the parser. In addition, calls to certain\n// rule entry methods may be omitted.</p>\n//\n// <p>With the following specific exceptions, calls to listener events are\n// <em>deterministic</em>, i.e. for identical input the calls to listener\n// methods will be the same.</p>\n//\n// <ul>\n// <li>Alterations to the grammar used to generate code may change the\n// behavior of the listener calls.</li>\n// <li>Alterations to the command line options passed to ANTLR 4 when\n// generating the parser may change the behavior of the listener calls.</li>\n// <li>Changing the version of the ANTLR Tool used to generate the parser\n// may change the behavior of the listener calls.</li>\n// </ul>\n//\n// @param listener the listener to add\n//\n// @throws NullPointerException if {@code} listener is {@code null}\n//\nParser.prototype.addParseListener = function(listener) {\n\tif (listener === null) {\n\t\tthrow \"listener\";\n\t}\n\tif (this._parseListeners === null) {\n\t\tthis._parseListeners = [];\n\t}\n\tthis._parseListeners.push(listener);\n};\n\n//\n// Remove {@code listener} from the list of parse listeners.\n//\n// <p>If {@code listener} is {@code null} or has not been added as a parse\n// listener, this method does nothing.</p>\n// @param listener the listener to remove\n//\nParser.prototype.removeParseListener = function(listener) {\n\tif (this._parseListeners !== null) {\n\t\tvar idx = this._parseListeners.indexOf(listener);\n\t\tif (idx >= 0) {\n\t\t\tthis._parseListeners.splice(idx, 1);\n\t\t}\n\t\tif (this._parseListeners.length === 0) {\n\t\t\tthis._parseListeners = null;\n\t\t}\n\t}\n};\n\n// Remove all parse listeners.\nParser.prototype.removeParseListeners = function() {\n\tthis._parseListeners = null;\n};\n\n// Notify any parse listeners of an enter rule event.\nParser.prototype.triggerEnterRuleEvent = function() {\n\tif (this._parseListeners !== null) {\n        var ctx = this._ctx;\n\t\tthis._parseListeners.map(function(listener) {\n\t\t\tlistener.enterEveryRule(ctx);\n\t\t\tctx.enterRule(listener);\n\t\t});\n\t}\n};\n\n//\n// Notify any parse listeners of an exit rule event.\n//\n// @see //addParseListener\n//\nParser.prototype.triggerExitRuleEvent = function() {\n\tif (this._parseListeners !== null) {\n\t\t// reverse order walk of listeners\n        var ctx = this._ctx;\n\t\tthis._parseListeners.slice(0).reverse().map(function(listener) {\n\t\t\tctx.exitRule(listener);\n\t\t\tlistener.exitEveryRule(ctx);\n\t\t});\n\t}\n};\n\nParser.prototype.getTokenFactory = function() {\n\treturn this._input.tokenSource._factory;\n};\n\n// Tell our token source and error strategy about a new way to create tokens.//\nParser.prototype.setTokenFactory = function(factory) {\n\tthis._input.tokenSource._factory = factory;\n};\n\n// The ATN with bypass alternatives is expensive to create so we create it\n// lazily.\n//\n// @throws UnsupportedOperationException if the current parser does not\n// implement the {@link //getSerializedATN()} method.\n//\nParser.prototype.getATNWithBypassAlts = function() {\n\tvar serializedAtn = this.getSerializedATN();\n\tif (serializedAtn === null) {\n\t\tthrow \"The current parser does not support an ATN with bypass alternatives.\";\n\t}\n\tvar result = this.bypassAltsAtnCache[serializedAtn];\n\tif (result === null) {\n\t\tvar deserializationOptions = new ATNDeserializationOptions();\n\t\tdeserializationOptions.generateRuleBypassTransitions = true;\n\t\tresult = new ATNDeserializer(deserializationOptions)\n\t\t\t\t.deserialize(serializedAtn);\n\t\tthis.bypassAltsAtnCache[serializedAtn] = result;\n\t}\n\treturn result;\n};\n\n// The preferred method of getting a tree pattern. For example, here's a\n// sample use:\n//\n// <pre>\n// ParseTree t = parser.expr();\n// ParseTreePattern p = parser.compileParseTreePattern(\"&lt;ID&gt;+0\",\n// MyParser.RULE_expr);\n// ParseTreeMatch m = p.match(t);\n// String id = m.get(\"ID\");\n// </pre>\n\nvar Lexer = require('./Lexer').Lexer;\n\nParser.prototype.compileParseTreePattern = function(pattern, patternRuleIndex, lexer) {\n\tlexer = lexer || null;\n\tif (lexer === null) {\n\t\tif (this.getTokenStream() !== null) {\n\t\t\tvar tokenSource = this.getTokenStream().tokenSource;\n\t\t\tif (tokenSource instanceof Lexer) {\n\t\t\t\tlexer = tokenSource;\n\t\t\t}\n\t\t}\n\t}\n\tif (lexer === null) {\n\t\tthrow \"Parser can't discover a lexer to use\";\n\t}\n\tvar m = new ParseTreePatternMatcher(lexer, this);\n\treturn m.compile(pattern, patternRuleIndex);\n};\n\nParser.prototype.getInputStream = function() {\n\treturn this.getTokenStream();\n};\n\nParser.prototype.setInputStream = function(input) {\n\tthis.setTokenStream(input);\n};\n\nParser.prototype.getTokenStream = function() {\n\treturn this._input;\n};\n\n// Set the token stream and reset the parser.//\nParser.prototype.setTokenStream = function(input) {\n\tthis._input = null;\n\tthis.reset();\n\tthis._input = input;\n};\n\n// Match needs to return the current input symbol, which gets put\n// into the label for the associated token ref; e.g., x=ID.\n//\nParser.prototype.getCurrentToken = function() {\n\treturn this._input.LT(1);\n};\n\nParser.prototype.notifyErrorListeners = function(msg, offendingToken, err) {\n\toffendingToken = offendingToken || null;\n\terr = err || null;\n\tif (offendingToken === null) {\n\t\toffendingToken = this.getCurrentToken();\n\t}\n\tthis._syntaxErrors += 1;\n\tvar line = offendingToken.line;\n\tvar column = offendingToken.column;\n\tvar listener = this.getErrorListenerDispatch();\n\tlistener.syntaxError(this, offendingToken, line, column, msg, err);\n};\n\n//\n// Consume and return the {@linkplain //getCurrentToken current symbol}.\n//\n// <p>E.g., given the following input with {@code A} being the current\n// lookahead symbol, this function moves the cursor to {@code B} and returns\n// {@code A}.</p>\n//\n// <pre>\n// A B\n// ^\n// </pre>\n//\n// If the parser is not in error recovery mode, the consumed symbol is added\n// to the parse tree using {@link ParserRuleContext//addChild(Token)}, and\n// {@link ParseTreeListener//visitTerminal} is called on any parse listeners.\n// If the parser <em>is</em> in error recovery mode, the consumed symbol is\n// added to the parse tree using\n// {@link ParserRuleContext//addErrorNode(Token)}, and\n// {@link ParseTreeListener//visitErrorNode} is called on any parse\n// listeners.\n//\nParser.prototype.consume = function() {\n\tvar o = this.getCurrentToken();\n\tif (o.type !== Token.EOF) {\n\t\tthis.getInputStream().consume();\n\t}\n\tvar hasListener = this._parseListeners !== null && this._parseListeners.length > 0;\n\tif (this.buildParseTrees || hasListener) {\n\t\tvar node;\n\t\tif (this._errHandler.inErrorRecoveryMode(this)) {\n\t\t\tnode = this._ctx.addErrorNode(o);\n\t\t} else {\n\t\t\tnode = this._ctx.addTokenNode(o);\n\t\t}\n        node.invokingState = this.state;\n\t\tif (hasListener) {\n\t\t\tthis._parseListeners.map(function(listener) {\n\t\t\t\tif (node instanceof ErrorNode || (node.isErrorNode !== undefined && node.isErrorNode())) {\n\t\t\t\t\tlistener.visitErrorNode(node);\n\t\t\t\t} else if (node instanceof TerminalNode) {\n\t\t\t\t\tlistener.visitTerminal(node);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\treturn o;\n};\n\nParser.prototype.addContextToParseTree = function() {\n\t// add current context to parent if we have a parent\n\tif (this._ctx.parentCtx !== null) {\n\t\tthis._ctx.parentCtx.addChild(this._ctx);\n\t}\n};\n\n// Always called by generated parsers upon entry to a rule. Access field\n// {@link //_ctx} get the current context.\n\nParser.prototype.enterRule = function(localctx, state, ruleIndex) {\n\tthis.state = state;\n\tthis._ctx = localctx;\n\tthis._ctx.start = this._input.LT(1);\n\tif (this.buildParseTrees) {\n\t\tthis.addContextToParseTree();\n\t}\n\tif (this._parseListeners !== null) {\n\t\tthis.triggerEnterRuleEvent();\n\t}\n};\n\nParser.prototype.exitRule = function() {\n\tthis._ctx.stop = this._input.LT(-1);\n\t// trigger event on _ctx, before it reverts to parent\n\tif (this._parseListeners !== null) {\n\t\tthis.triggerExitRuleEvent();\n\t}\n\tthis.state = this._ctx.invokingState;\n\tthis._ctx = this._ctx.parentCtx;\n};\n\nParser.prototype.enterOuterAlt = function(localctx, altNum) {\n   \tlocalctx.setAltNumber(altNum);\n\t// if we have new localctx, make sure we replace existing ctx\n\t// that is previous child of parse tree\n\tif (this.buildParseTrees && this._ctx !== localctx) {\n\t\tif (this._ctx.parentCtx !== null) {\n\t\t\tthis._ctx.parentCtx.removeLastChild();\n\t\t\tthis._ctx.parentCtx.addChild(localctx);\n\t\t}\n\t}\n\tthis._ctx = localctx;\n};\n\n// Get the precedence level for the top-most precedence rule.\n//\n// @return The precedence level for the top-most precedence rule, or -1 if\n// the parser context is not nested within a precedence rule.\n\nParser.prototype.getPrecedence = function() {\n\tif (this._precedenceStack.length === 0) {\n\t\treturn -1;\n\t} else {\n\t\treturn this._precedenceStack[this._precedenceStack.length-1];\n\t}\n};\n\nParser.prototype.enterRecursionRule = function(localctx, state, ruleIndex,\n\t\tprecedence) {\n\tthis.state = state;\n\tthis._precedenceStack.push(precedence);\n\tthis._ctx = localctx;\n\tthis._ctx.start = this._input.LT(1);\n\tif (this._parseListeners !== null) {\n\t\tthis.triggerEnterRuleEvent(); // simulates rule entry for\n\t\t\t\t\t\t\t\t\t\t// left-recursive rules\n\t}\n};\n\n//\n// Like {@link //enterRule} but for recursive rules.\n\nParser.prototype.pushNewRecursionContext = function(localctx, state, ruleIndex) {\n\tvar previous = this._ctx;\n\tprevious.parentCtx = localctx;\n\tprevious.invokingState = state;\n\tprevious.stop = this._input.LT(-1);\n\n\tthis._ctx = localctx;\n\tthis._ctx.start = previous.start;\n\tif (this.buildParseTrees) {\n\t\tthis._ctx.addChild(previous);\n\t}\n\tif (this._parseListeners !== null) {\n\t\tthis.triggerEnterRuleEvent(); // simulates rule entry for\n\t\t\t\t\t\t\t\t\t\t// left-recursive rules\n\t}\n};\n\nParser.prototype.unrollRecursionContexts = function(parentCtx) {\n\tthis._precedenceStack.pop();\n\tthis._ctx.stop = this._input.LT(-1);\n\tvar retCtx = this._ctx; // save current ctx (return value)\n\t// unroll so _ctx is as it was before call to recursive method\n\tif (this._parseListeners !== null) {\n\t\twhile (this._ctx !== parentCtx) {\n\t\t\tthis.triggerExitRuleEvent();\n\t\t\tthis._ctx = this._ctx.parentCtx;\n\t\t}\n\t} else {\n\t\tthis._ctx = parentCtx;\n\t}\n\t// hook into tree\n\tretCtx.parentCtx = parentCtx;\n\tif (this.buildParseTrees && parentCtx !== null) {\n\t\t// add return ctx into invoking rule's tree\n\t\tparentCtx.addChild(retCtx);\n\t}\n};\n\nParser.prototype.getInvokingContext = function(ruleIndex) {\n\tvar ctx = this._ctx;\n\twhile (ctx !== null) {\n\t\tif (ctx.ruleIndex === ruleIndex) {\n\t\t\treturn ctx;\n\t\t}\n\t\tctx = ctx.parentCtx;\n\t}\n\treturn null;\n};\n\nParser.prototype.precpred = function(localctx, precedence) {\n\treturn precedence >= this._precedenceStack[this._precedenceStack.length-1];\n};\n\nParser.prototype.inContext = function(context) {\n\t// TODO: useful in parser?\n\treturn false;\n};\n\n//\n// Checks whether or not {@code symbol} can follow the current state in the\n// ATN. The behavior of this method is equivalent to the following, but is\n// implemented such that the complete context-sensitive follow set does not\n// need to be explicitly constructed.\n//\n// <pre>\n// return getExpectedTokens().contains(symbol);\n// </pre>\n//\n// @param symbol the symbol type to check\n// @return {@code true} if {@code symbol} can follow the current state in\n// the ATN, otherwise {@code false}.\n\nParser.prototype.isExpectedToken = function(symbol) {\n\tvar atn = this._interp.atn;\n\tvar ctx = this._ctx;\n\tvar s = atn.states[this.state];\n\tvar following = atn.nextTokens(s);\n\tif (following.contains(symbol)) {\n\t\treturn true;\n\t}\n\tif (!following.contains(Token.EPSILON)) {\n\t\treturn false;\n\t}\n\twhile (ctx !== null && ctx.invokingState >= 0 && following.contains(Token.EPSILON)) {\n\t\tvar invokingState = atn.states[ctx.invokingState];\n\t\tvar rt = invokingState.transitions[0];\n\t\tfollowing = atn.nextTokens(rt.followState);\n\t\tif (following.contains(symbol)) {\n\t\t\treturn true;\n\t\t}\n\t\tctx = ctx.parentCtx;\n\t}\n\tif (following.contains(Token.EPSILON) && symbol === Token.EOF) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n};\n\n// Computes the set of input symbols which could follow the current parser\n// state and context, as given by {@link //getState} and {@link //getContext},\n// respectively.\n//\n// @see ATN//getExpectedTokens(int, RuleContext)\n//\nParser.prototype.getExpectedTokens = function() {\n\treturn this._interp.atn.getExpectedTokens(this.state, this._ctx);\n};\n\nParser.prototype.getExpectedTokensWithinCurrentRule = function() {\n\tvar atn = this._interp.atn;\n\tvar s = atn.states[this.state];\n\treturn atn.nextTokens(s);\n};\n\n// Get a rule's index (i.e., {@code RULE_ruleName} field) or -1 if not found.//\nParser.prototype.getRuleIndex = function(ruleName) {\n\tvar ruleIndex = this.getRuleIndexMap()[ruleName];\n\tif (ruleIndex !== null) {\n\t\treturn ruleIndex;\n\t} else {\n\t\treturn -1;\n\t}\n};\n\n// Return List&lt;String&gt; of the rule names in your parser instance\n// leading up to a call to the current rule. You could override if\n// you want more details such as the file/line info of where\n// in the ATN a rule is invoked.\n//\n// this is very useful for error messages.\n//\nParser.prototype.getRuleInvocationStack = function(p) {\n\tp = p || null;\n\tif (p === null) {\n\t\tp = this._ctx;\n\t}\n\tvar stack = [];\n\twhile (p !== null) {\n\t\t// compute what follows who invoked us\n\t\tvar ruleIndex = p.ruleIndex;\n\t\tif (ruleIndex < 0) {\n\t\t\tstack.push(\"n/a\");\n\t\t} else {\n\t\t\tstack.push(this.ruleNames[ruleIndex]);\n\t\t}\n\t\tp = p.parentCtx;\n\t}\n\treturn stack;\n};\n\n// For debugging and other purposes.//\nParser.prototype.getDFAStrings = function() {\n\treturn this._interp.decisionToDFA.toString();\n};\n// For debugging and other purposes.//\nParser.prototype.dumpDFA = function() {\n\tvar seenOne = false;\n\tfor (var i = 0; i < this._interp.decisionToDFA.length; i++) {\n\t\tvar dfa = this._interp.decisionToDFA[i];\n\t\tif (dfa.states.length > 0) {\n\t\t\tif (seenOne) {\n\t\t\t\tconsole.log();\n\t\t\t}\n\t\t\tthis.printer.println(\"Decision \" + dfa.decision + \":\");\n\t\t\tthis.printer.print(dfa.toString(this.literalNames, this.symbolicNames));\n\t\t\tseenOne = true;\n\t\t}\n\t}\n};\n\n/*\n\"\t\t\tprinter = function() {\\r\\n\" +\n\"\t\t\t\tthis.println = function(s) { document.getElementById('output') += s + '\\\\n'; }\\r\\n\" +\n\"\t\t\t\tthis.print = function(s) { document.getElementById('output') += s; }\\r\\n\" +\n\"\t\t\t};\\r\\n\" +\n*/\n\nParser.prototype.getSourceName = function() {\n\treturn this._input.sourceName;\n};\n\n// During a parse is sometimes useful to listen in on the rule entry and exit\n// events as well as token matches. this is for quick and dirty debugging.\n//\nParser.prototype.setTrace = function(trace) {\n\tif (!trace) {\n\t\tthis.removeParseListener(this._tracer);\n\t\tthis._tracer = null;\n\t} else {\n\t\tif (this._tracer !== null) {\n\t\t\tthis.removeParseListener(this._tracer);\n\t\t}\n\t\tthis._tracer = new TraceListener(this);\n\t\tthis.addParseListener(this._tracer);\n\t}\n};\n\nexports.Parser = Parser;","/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n\n//* A rule invocation record for parsing.\n//\n//  Contains all of the information about the current rule not stored in the\n//  RuleContext. It handles parse tree children list, Any ATN state\n//  tracing, and the default values available for rule indications:\n//  start, stop, rule index, current alt number, current\n//  ATN state.\n//\n//  Subclasses made for each rule and grammar track the parameters,\n//  return values, locals, and labels specific to that rule. These\n//  are the objects that are returned from rules.\n//\n//  Note text is not an actual field of a rule return value; it is computed\n//  from start and stop using the input stream's toString() method.  I\n//  could add a ctor to this so that we can pass in and store the input\n//  stream, but I'm not sure we want to do that.  It would seem to be undefined\n//  to get the .text property anyway if the rule matches tokens from multiple\n//  input streams.\n//\n//  I do not use getters for fields of objects that are used simply to\n//  group values such as this aggregate.  The getters/setters are there to\n//  satisfy the superclass interface.\n\nvar RuleContext = require('./RuleContext').RuleContext;\nvar Tree = require('./tree/Tree');\nvar INVALID_INTERVAL = Tree.INVALID_INTERVAL;\nvar TerminalNode = Tree.TerminalNode;\nvar TerminalNodeImpl = Tree.TerminalNodeImpl;\nvar ErrorNodeImpl = Tree.ErrorNodeImpl;\nvar Interval = require(\"./IntervalSet\").Interval;\n\nfunction ParserRuleContext(parent, invokingStateNumber) {\n\tparent = parent || null;\n\tinvokingStateNumber = invokingStateNumber || null;\n\tRuleContext.call(this, parent, invokingStateNumber);\n\tthis.ruleIndex = -1;\n    // * If we are debugging or building a parse tree for a visitor,\n    // we need to track all of the tokens and rule invocations associated\n    // with this rule's context. This is empty for parsing w/o tree constr.\n    // operation because we don't the need to track the details about\n    // how we parse this rule.\n    // /\n    this.children = null;\n    this.start = null;\n    this.stop = null;\n    // The exception that forced this rule to return. If the rule successfully\n    // completed, this is {@code null}.\n    this.exception = null;\n}\n\nParserRuleContext.prototype = Object.create(RuleContext.prototype);\nParserRuleContext.prototype.constructor = ParserRuleContext;\n\n// * COPY a ctx (I'm deliberately not using copy constructor)///\nParserRuleContext.prototype.copyFrom = function(ctx) {\n    // from RuleContext\n    this.parentCtx = ctx.parentCtx;\n    this.invokingState = ctx.invokingState;\n    this.children = null;\n    this.start = ctx.start;\n    this.stop = ctx.stop;\n    // copy any error nodes to alt label node\n    if(ctx.children) {\n        this.children = [];\n        // reset parent pointer for any error nodes\n    \tctx.children.map(function(child) {\n    \t\tif (child instanceof ErrorNodeImpl) {\n                this.children.push(child);\n                child.parentCtx = this;\n            }\n\t\t}, this);\n\t}\n};\n\n// Double dispatch methods for listeners\nParserRuleContext.prototype.enterRule = function(listener) {\n};\n\nParserRuleContext.prototype.exitRule = function(listener) {\n};\n\n// * Does not set parent link; other add methods do that///\nParserRuleContext.prototype.addChild = function(child) {\n    if (this.children === null) {\n        this.children = [];\n    }\n    this.children.push(child);\n    return child;\n};\n\n// * Used by enterOuterAlt to toss out a RuleContext previously added as\n// we entered a rule. If we have // label, we will need to remove\n// generic ruleContext object.\n// /\nParserRuleContext.prototype.removeLastChild = function() {\n    if (this.children !== null) {\n        this.children.pop();\n    }\n};\n\nParserRuleContext.prototype.addTokenNode = function(token) {\n    var node = new TerminalNodeImpl(token);\n    this.addChild(node);\n    node.parentCtx = this;\n    return node;\n};\n\nParserRuleContext.prototype.addErrorNode = function(badToken) {\n    var node = new ErrorNodeImpl(badToken);\n    this.addChild(node);\n    node.parentCtx = this;\n    return node;\n};\n\nParserRuleContext.prototype.getChild = function(i, type) {\n\ttype = type || null;\n\tif (this.children === null || i < 0 || i >= this.children.length) {\n\t\treturn null;\n\t}\n\tif (type === null) {\n\t\treturn this.children[i];\n\t} else {\n\t\tfor(var j=0; j<this.children.length; j++) {\n\t\t\tvar child = this.children[j];\n\t\t\tif(child instanceof type) {\n\t\t\t\tif(i===0) {\n\t\t\t\t\treturn child;\n\t\t\t\t} else {\n\t\t\t\t\ti -= 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn null;\n    }\n};\n\n\nParserRuleContext.prototype.getToken = function(ttype, i) {\n\tif (this.children === null || i < 0 || i >= this.children.length) {\n\t\treturn null;\n\t}\n\tfor(var j=0; j<this.children.length; j++) {\n\t\tvar child = this.children[j];\n\t\tif (child instanceof TerminalNode) {\n\t\t\tif (child.symbol.type === ttype) {\n\t\t\t\tif(i===0) {\n\t\t\t\t\treturn child;\n\t\t\t\t} else {\n\t\t\t\t\ti -= 1;\n\t\t\t\t}\n\t\t\t}\n        }\n\t}\n    return null;\n};\n\nParserRuleContext.prototype.getTokens = function(ttype ) {\n    if (this.children=== null) {\n        return [];\n    } else {\n\t\tvar tokens = [];\n\t\tfor(var j=0; j<this.children.length; j++) {\n\t\t\tvar child = this.children[j];\n\t\t\tif (child instanceof TerminalNode) {\n\t\t\t\tif (child.symbol.type === ttype) {\n\t\t\t\t\ttokens.push(child);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn tokens;\n    }\n};\n\nParserRuleContext.prototype.getTypedRuleContext = function(ctxType, i) {\n    return this.getChild(i, ctxType);\n};\n\nParserRuleContext.prototype.getTypedRuleContexts = function(ctxType) {\n    if (this.children=== null) {\n        return [];\n    } else {\n\t\tvar contexts = [];\n\t\tfor(var j=0; j<this.children.length; j++) {\n\t\t\tvar child = this.children[j];\n\t\t\tif (child instanceof ctxType) {\n\t\t\t\tcontexts.push(child);\n\t\t\t}\n\t\t}\n\t\treturn contexts;\n\t}\n};\n\nParserRuleContext.prototype.getChildCount = function() {\n\tif (this.children=== null) {\n\t\treturn 0;\n\t} else {\n\t\treturn this.children.length;\n\t}\n};\n\nParserRuleContext.prototype.getSourceInterval = function() {\n    if( this.start === null || this.stop === null) {\n        return INVALID_INTERVAL;\n    } else {\n        return new Interval(this.start.tokenIndex, this.stop.tokenIndex);\n    }\n};\n\nRuleContext.EMPTY = new ParserRuleContext();\n\nfunction InterpreterRuleContext(parent, invokingStateNumber, ruleIndex) {\n\tParserRuleContext.call(parent, invokingStateNumber);\n    this.ruleIndex = ruleIndex;\n    return this;\n}\n\nInterpreterRuleContext.prototype = Object.create(ParserRuleContext.prototype);\nInterpreterRuleContext.prototype.constructor = InterpreterRuleContext;\n\nexports.ParserRuleContext = ParserRuleContext;","//\n/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n///\n\nvar RuleContext = require('./RuleContext').RuleContext;\nvar Hash = require('./Utils').Hash;\n\nfunction PredictionContext(cachedHashCode) {\n\tthis.cachedHashCode = cachedHashCode;\n}\n\n// Represents {@code $} in local context prediction, which means wildcard.\n// {@code//+x =//}.\n// /\nPredictionContext.EMPTY = null;\n\n// Represents {@code $} in an array in full context mode, when {@code $}\n// doesn't mean wildcard: {@code $ + x = [$,x]}. Here,\n// {@code $} = {@link //EMPTY_RETURN_STATE}.\n// /\nPredictionContext.EMPTY_RETURN_STATE = 0x7FFFFFFF;\n\nPredictionContext.globalNodeCount = 1;\nPredictionContext.id = PredictionContext.globalNodeCount;\n\n// Stores the computed hash code of this {@link PredictionContext}. The hash\n// code is computed in parts to match the following reference algorithm.\n//\n// <pre>\n// private int referenceHashCode() {\n// int hash = {@link MurmurHash//initialize MurmurHash.initialize}({@link\n// //INITIAL_HASH});\n//\n// for (int i = 0; i &lt; {@link //size()}; i++) {\n// hash = {@link MurmurHash//update MurmurHash.update}(hash, {@link //getParent\n// getParent}(i));\n// }\n//\n// for (int i = 0; i &lt; {@link //size()}; i++) {\n// hash = {@link MurmurHash//update MurmurHash.update}(hash, {@link\n// //getReturnState getReturnState}(i));\n// }\n//\n// hash = {@link MurmurHash//finish MurmurHash.finish}(hash, 2// {@link\n// //size()});\n// return hash;\n// }\n// </pre>\n// /\n\n// This means only the {@link //EMPTY} context is in set.\nPredictionContext.prototype.isEmpty = function() {\n\treturn this === PredictionContext.EMPTY;\n};\n\nPredictionContext.prototype.hasEmptyPath = function() {\n\treturn this.getReturnState(this.length - 1) === PredictionContext.EMPTY_RETURN_STATE;\n};\n\nPredictionContext.prototype.hashCode = function() {\n\treturn this.cachedHashCode;\n};\n\n\nPredictionContext.prototype.updateHashCode = function(hash) {\n    hash.update(this.cachedHashCode);\n};\n/*\nfunction calculateHashString(parent, returnState) {\n\treturn \"\" + parent + returnState;\n}\n*/\n\n// Used to cache {@link PredictionContext} objects. Its used for the shared\n// context cash associated with contexts in DFA states. This cache\n// can be used for both lexers and parsers.\n\nfunction PredictionContextCache() {\n\tthis.cache = {};\n\treturn this;\n}\n\n// Add a context to the cache and return it. If the context already exists,\n// return that one instead and do not add a new context to the cache.\n// Protect shared cache from unsafe thread access.\n//\nPredictionContextCache.prototype.add = function(ctx) {\n\tif (ctx === PredictionContext.EMPTY) {\n\t\treturn PredictionContext.EMPTY;\n\t}\n\tvar existing = this.cache[ctx] || null;\n\tif (existing !== null) {\n\t\treturn existing;\n\t}\n\tthis.cache[ctx] = ctx;\n\treturn ctx;\n};\n\nPredictionContextCache.prototype.get = function(ctx) {\n\treturn this.cache[ctx] || null;\n};\n\nObject.defineProperty(PredictionContextCache.prototype, \"length\", {\n\tget : function() {\n\t\treturn this.cache.length;\n\t}\n});\n\nfunction SingletonPredictionContext(parent, returnState) {\n\tvar hashCode = 0;\n\tif(parent !== null) {\n\t\tvar hash = new Hash();\n\t\thash.update(parent, returnState);\n        hashCode = hash.finish();\n\t}\n\tPredictionContext.call(this, hashCode);\n\tthis.parentCtx = parent;\n\tthis.returnState = returnState;\n}\n\nSingletonPredictionContext.prototype = Object.create(PredictionContext.prototype);\nSingletonPredictionContext.prototype.contructor = SingletonPredictionContext;\n\nSingletonPredictionContext.create = function(parent, returnState) {\n\tif (returnState === PredictionContext.EMPTY_RETURN_STATE && parent === null) {\n\t\t// someone can pass in the bits of an array ctx that mean $\n\t\treturn PredictionContext.EMPTY;\n\t} else {\n\t\treturn new SingletonPredictionContext(parent, returnState);\n\t}\n};\n\nObject.defineProperty(SingletonPredictionContext.prototype, \"length\", {\n\tget : function() {\n\t\treturn 1;\n\t}\n});\n\nSingletonPredictionContext.prototype.getParent = function(index) {\n\treturn this.parentCtx;\n};\n\nSingletonPredictionContext.prototype.getReturnState = function(index) {\n\treturn this.returnState;\n};\n\nSingletonPredictionContext.prototype.equals = function(other) {\n\tif (this === other) {\n\t\treturn true;\n\t} else if (!(other instanceof SingletonPredictionContext)) {\n\t\treturn false;\n\t} else if (this.hashCode() !== other.hashCode()) {\n\t\treturn false; // can't be same if hash is different\n\t} else {\n\t\tif(this.returnState !== other.returnState)\n            return false;\n        else if(this.parentCtx==null)\n            return other.parentCtx==null\n\t\telse\n            return this.parentCtx.equals(other.parentCtx);\n\t}\n};\n\nSingletonPredictionContext.prototype.toString = function() {\n\tvar up = this.parentCtx === null ? \"\" : this.parentCtx.toString();\n\tif (up.length === 0) {\n\t\tif (this.returnState === PredictionContext.EMPTY_RETURN_STATE) {\n\t\t\treturn \"$\";\n\t\t} else {\n\t\t\treturn \"\" + this.returnState;\n\t\t}\n\t} else {\n\t\treturn \"\" + this.returnState + \" \" + up;\n\t}\n};\n\nfunction EmptyPredictionContext() {\n\tSingletonPredictionContext.call(this, null, PredictionContext.EMPTY_RETURN_STATE);\n\treturn this;\n}\n\nEmptyPredictionContext.prototype = Object.create(SingletonPredictionContext.prototype);\nEmptyPredictionContext.prototype.constructor = EmptyPredictionContext;\n\nEmptyPredictionContext.prototype.isEmpty = function() {\n\treturn true;\n};\n\nEmptyPredictionContext.prototype.getParent = function(index) {\n\treturn null;\n};\n\nEmptyPredictionContext.prototype.getReturnState = function(index) {\n\treturn this.returnState;\n};\n\nEmptyPredictionContext.prototype.equals = function(other) {\n\treturn this === other;\n};\n\nEmptyPredictionContext.prototype.toString = function() {\n\treturn \"$\";\n};\n\nPredictionContext.EMPTY = new EmptyPredictionContext();\n\nfunction ArrayPredictionContext(parents, returnStates) {\n\t// Parent can be null only if full ctx mode and we make an array\n\t// from {@link //EMPTY} and non-empty. We merge {@link //EMPTY} by using\n\t// null parent and\n\t// returnState == {@link //EMPTY_RETURN_STATE}.\n\tvar h = new Hash();\n\th.update(parents, returnStates);\n\tvar hashCode = h.finish();\n\tPredictionContext.call(this, hashCode);\n\tthis.parents = parents;\n\tthis.returnStates = returnStates;\n\treturn this;\n}\n\nArrayPredictionContext.prototype = Object.create(PredictionContext.prototype);\nArrayPredictionContext.prototype.constructor = ArrayPredictionContext;\n\nArrayPredictionContext.prototype.isEmpty = function() {\n\t// since EMPTY_RETURN_STATE can only appear in the last position, we\n\t// don't need to verify that size==1\n\treturn this.returnStates[0] === PredictionContext.EMPTY_RETURN_STATE;\n};\n\nObject.defineProperty(ArrayPredictionContext.prototype, \"length\", {\n\tget : function() {\n\t\treturn this.returnStates.length;\n\t}\n});\n\nArrayPredictionContext.prototype.getParent = function(index) {\n\treturn this.parents[index];\n};\n\nArrayPredictionContext.prototype.getReturnState = function(index) {\n\treturn this.returnStates[index];\n};\n\nArrayPredictionContext.prototype.equals = function(other) {\n\tif (this === other) {\n\t\treturn true;\n\t} else if (!(other instanceof ArrayPredictionContext)) {\n\t\treturn false;\n\t} else if (this.hashCode() !== other.hashCode()) {\n\t\treturn false; // can't be same if hash is different\n\t} else {\n\t\treturn this.returnStates === other.returnStates &&\n\t\t\t\tthis.parents === other.parents;\n\t}\n};\n\nArrayPredictionContext.prototype.toString = function() {\n\tif (this.isEmpty()) {\n\t\treturn \"[]\";\n\t} else {\n\t\tvar s = \"[\";\n\t\tfor (var i = 0; i < this.returnStates.length; i++) {\n\t\t\tif (i > 0) {\n\t\t\t\ts = s + \", \";\n\t\t\t}\n\t\t\tif (this.returnStates[i] === PredictionContext.EMPTY_RETURN_STATE) {\n\t\t\t\ts = s + \"$\";\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\ts = s + this.returnStates[i];\n\t\t\tif (this.parents[i] !== null) {\n\t\t\t\ts = s + \" \" + this.parents[i];\n\t\t\t} else {\n\t\t\t\ts = s + \"null\";\n\t\t\t}\n\t\t}\n\t\treturn s + \"]\";\n\t}\n};\n\n// Convert a {@link RuleContext} tree to a {@link PredictionContext} graph.\n// Return {@link //EMPTY} if {@code outerContext} is empty or null.\n// /\nfunction predictionContextFromRuleContext(atn, outerContext) {\n\tif (outerContext === undefined || outerContext === null) {\n\t\touterContext = RuleContext.EMPTY;\n\t}\n\t// if we are in RuleContext of start rule, s, then PredictionContext\n\t// is EMPTY. Nobody called us. (if we are empty, return empty)\n\tif (outerContext.parentCtx === null || outerContext === RuleContext.EMPTY) {\n\t\treturn PredictionContext.EMPTY;\n\t}\n\t// If we have a parent, convert it to a PredictionContext graph\n\tvar parent = predictionContextFromRuleContext(atn, outerContext.parentCtx);\n\tvar state = atn.states[outerContext.invokingState];\n\tvar transition = state.transitions[0];\n\treturn SingletonPredictionContext.create(parent, transition.followState.stateNumber);\n}\n/*\nfunction calculateListsHashString(parents, returnStates) {\n\tvar s = \"\";\n\tparents.map(function(p) {\n\t\ts = s + p;\n\t});\n\treturnStates.map(function(r) {\n\t\ts = s + r;\n\t});\n\treturn s;\n}\n*/\nfunction merge(a, b, rootIsWildcard, mergeCache) {\n\t// share same graph if both same\n\tif (a === b) {\n\t\treturn a;\n\t}\n\tif (a instanceof SingletonPredictionContext && b instanceof SingletonPredictionContext) {\n\t\treturn mergeSingletons(a, b, rootIsWildcard, mergeCache);\n\t}\n\t// At least one of a or b is array\n\t// If one is $ and rootIsWildcard, return $ as// wildcard\n\tif (rootIsWildcard) {\n\t\tif (a instanceof EmptyPredictionContext) {\n\t\t\treturn a;\n\t\t}\n\t\tif (b instanceof EmptyPredictionContext) {\n\t\t\treturn b;\n\t\t}\n\t}\n\t// convert singleton so both are arrays to normalize\n\tif (a instanceof SingletonPredictionContext) {\n\t\ta = new ArrayPredictionContext([a.getParent()], [a.returnState]);\n\t}\n\tif (b instanceof SingletonPredictionContext) {\n\t\tb = new ArrayPredictionContext([b.getParent()], [b.returnState]);\n\t}\n\treturn mergeArrays(a, b, rootIsWildcard, mergeCache);\n}\n\n//\n// Merge two {@link SingletonPredictionContext} instances.\n//\n// <p>Stack tops equal, parents merge is same; return left graph.<br>\n// <embed src=\"images/SingletonMerge_SameRootSamePar.svg\"\n// type=\"image/svg+xml\"/></p>\n//\n// <p>Same stack top, parents differ; merge parents giving array node, then\n// remainders of those graphs. A new root node is created to point to the\n// merged parents.<br>\n// <embed src=\"images/SingletonMerge_SameRootDiffPar.svg\"\n// type=\"image/svg+xml\"/></p>\n//\n// <p>Different stack tops pointing to same parent. Make array node for the\n// root where both element in the root point to the same (original)\n// parent.<br>\n// <embed src=\"images/SingletonMerge_DiffRootSamePar.svg\"\n// type=\"image/svg+xml\"/></p>\n//\n// <p>Different stack tops pointing to different parents. Make array node for\n// the root where each element points to the corresponding original\n// parent.<br>\n// <embed src=\"images/SingletonMerge_DiffRootDiffPar.svg\"\n// type=\"image/svg+xml\"/></p>\n//\n// @param a the first {@link SingletonPredictionContext}\n// @param b the second {@link SingletonPredictionContext}\n// @param rootIsWildcard {@code true} if this is a local-context merge,\n// otherwise false to indicate a full-context merge\n// @param mergeCache\n// /\nfunction mergeSingletons(a, b, rootIsWildcard, mergeCache) {\n\tif (mergeCache !== null) {\n\t\tvar previous = mergeCache.get(a, b);\n\t\tif (previous !== null) {\n\t\t\treturn previous;\n\t\t}\n\t\tprevious = mergeCache.get(b, a);\n\t\tif (previous !== null) {\n\t\t\treturn previous;\n\t\t}\n\t}\n\n\tvar rootMerge = mergeRoot(a, b, rootIsWildcard);\n\tif (rootMerge !== null) {\n\t\tif (mergeCache !== null) {\n\t\t\tmergeCache.set(a, b, rootMerge);\n\t\t}\n\t\treturn rootMerge;\n\t}\n\tif (a.returnState === b.returnState) {\n\t\tvar parent = merge(a.parentCtx, b.parentCtx, rootIsWildcard, mergeCache);\n\t\t// if parent is same as existing a or b parent or reduced to a parent,\n\t\t// return it\n\t\tif (parent === a.parentCtx) {\n\t\t\treturn a; // ax + bx = ax, if a=b\n\t\t}\n\t\tif (parent === b.parentCtx) {\n\t\t\treturn b; // ax + bx = bx, if a=b\n\t\t}\n\t\t// else: ax + ay = a'[x,y]\n\t\t// merge parents x and y, giving array node with x,y then remainders\n\t\t// of those graphs. dup a, a' points at merged array\n\t\t// new joined parent so create new singleton pointing to it, a'\n\t\tvar spc = SingletonPredictionContext.create(parent, a.returnState);\n\t\tif (mergeCache !== null) {\n\t\t\tmergeCache.set(a, b, spc);\n\t\t}\n\t\treturn spc;\n\t} else { // a != b payloads differ\n\t\t// see if we can collapse parents due to $+x parents if local ctx\n\t\tvar singleParent = null;\n\t\tif (a === b || (a.parentCtx !== null && a.parentCtx === b.parentCtx)) { // ax +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// bx =\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// [a,b]x\n\t\t\tsingleParent = a.parentCtx;\n\t\t}\n\t\tif (singleParent !== null) { // parents are same\n\t\t\t// sort payloads and use same parent\n\t\t\tvar payloads = [ a.returnState, b.returnState ];\n\t\t\tif (a.returnState > b.returnState) {\n\t\t\t\tpayloads[0] = b.returnState;\n\t\t\t\tpayloads[1] = a.returnState;\n\t\t\t}\n\t\t\tvar parents = [ singleParent, singleParent ];\n\t\t\tvar apc = new ArrayPredictionContext(parents, payloads);\n\t\t\tif (mergeCache !== null) {\n\t\t\t\tmergeCache.set(a, b, apc);\n\t\t\t}\n\t\t\treturn apc;\n\t\t}\n\t\t// parents differ and can't merge them. Just pack together\n\t\t// into array; can't merge.\n\t\t// ax + by = [ax,by]\n\t\tvar payloads = [ a.returnState, b.returnState ];\n\t\tvar parents = [ a.parentCtx, b.parentCtx ];\n\t\tif (a.returnState > b.returnState) { // sort by payload\n\t\t\tpayloads[0] = b.returnState;\n\t\t\tpayloads[1] = a.returnState;\n\t\t\tparents = [ b.parentCtx, a.parentCtx ];\n\t\t}\n\t\tvar a_ = new ArrayPredictionContext(parents, payloads);\n\t\tif (mergeCache !== null) {\n\t\t\tmergeCache.set(a, b, a_);\n\t\t}\n\t\treturn a_;\n\t}\n}\n\n//\n// Handle case where at least one of {@code a} or {@code b} is\n// {@link //EMPTY}. In the following diagrams, the symbol {@code $} is used\n// to represent {@link //EMPTY}.\n//\n// <h2>Local-Context Merges</h2>\n//\n// <p>These local-context merge operations are used when {@code rootIsWildcard}\n// is true.</p>\n//\n// <p>{@link //EMPTY} is superset of any graph; return {@link //EMPTY}.<br>\n// <embed src=\"images/LocalMerge_EmptyRoot.svg\" type=\"image/svg+xml\"/></p>\n//\n// <p>{@link //EMPTY} and anything is {@code //EMPTY}, so merged parent is\n// {@code //EMPTY}; return left graph.<br>\n// <embed src=\"images/LocalMerge_EmptyParent.svg\" type=\"image/svg+xml\"/></p>\n//\n// <p>Special case of last merge if local context.<br>\n// <embed src=\"images/LocalMerge_DiffRoots.svg\" type=\"image/svg+xml\"/></p>\n//\n// <h2>Full-Context Merges</h2>\n//\n// <p>These full-context merge operations are used when {@code rootIsWildcard}\n// is false.</p>\n//\n// <p><embed src=\"images/FullMerge_EmptyRoots.svg\" type=\"image/svg+xml\"/></p>\n//\n// <p>Must keep all contexts; {@link //EMPTY} in array is a special value (and\n// null parent).<br>\n// <embed src=\"images/FullMerge_EmptyRoot.svg\" type=\"image/svg+xml\"/></p>\n//\n// <p><embed src=\"images/FullMerge_SameRoot.svg\" type=\"image/svg+xml\"/></p>\n//\n// @param a the first {@link SingletonPredictionContext}\n// @param b the second {@link SingletonPredictionContext}\n// @param rootIsWildcard {@code true} if this is a local-context merge,\n// otherwise false to indicate a full-context merge\n// /\nfunction mergeRoot(a, b, rootIsWildcard) {\n\tif (rootIsWildcard) {\n\t\tif (a === PredictionContext.EMPTY) {\n\t\t\treturn PredictionContext.EMPTY; // // + b =//\n\t\t}\n\t\tif (b === PredictionContext.EMPTY) {\n\t\t\treturn PredictionContext.EMPTY; // a +// =//\n\t\t}\n\t} else {\n\t\tif (a === PredictionContext.EMPTY && b === PredictionContext.EMPTY) {\n\t\t\treturn PredictionContext.EMPTY; // $ + $ = $\n\t\t} else if (a === PredictionContext.EMPTY) { // $ + x = [$,x]\n\t\t\tvar payloads = [ b.returnState,\n\t\t\t\t\tPredictionContext.EMPTY_RETURN_STATE ];\n\t\t\tvar parents = [ b.parentCtx, null ];\n\t\t\treturn new ArrayPredictionContext(parents, payloads);\n\t\t} else if (b === PredictionContext.EMPTY) { // x + $ = [$,x] ($ is always first if present)\n\t\t\tvar payloads = [ a.returnState, PredictionContext.EMPTY_RETURN_STATE ];\n\t\t\tvar parents = [ a.parentCtx, null ];\n\t\t\treturn new ArrayPredictionContext(parents, payloads);\n\t\t}\n\t}\n\treturn null;\n}\n\n//\n// Merge two {@link ArrayPredictionContext} instances.\n//\n// <p>Different tops, different parents.<br>\n// <embed src=\"images/ArrayMerge_DiffTopDiffPar.svg\" type=\"image/svg+xml\"/></p>\n//\n// <p>Shared top, same parents.<br>\n// <embed src=\"images/ArrayMerge_ShareTopSamePar.svg\" type=\"image/svg+xml\"/></p>\n//\n// <p>Shared top, different parents.<br>\n// <embed src=\"images/ArrayMerge_ShareTopDiffPar.svg\" type=\"image/svg+xml\"/></p>\n//\n// <p>Shared top, all shared parents.<br>\n// <embed src=\"images/ArrayMerge_ShareTopSharePar.svg\"\n// type=\"image/svg+xml\"/></p>\n//\n// <p>Equal tops, merge parents and reduce top to\n// {@link SingletonPredictionContext}.<br>\n// <embed src=\"images/ArrayMerge_EqualTop.svg\" type=\"image/svg+xml\"/></p>\n// /\nfunction mergeArrays(a, b, rootIsWildcard, mergeCache) {\n\tif (mergeCache !== null) {\n\t\tvar previous = mergeCache.get(a, b);\n\t\tif (previous !== null) {\n\t\t\treturn previous;\n\t\t}\n\t\tprevious = mergeCache.get(b, a);\n\t\tif (previous !== null) {\n\t\t\treturn previous;\n\t\t}\n\t}\n\t// merge sorted payloads a + b => M\n\tvar i = 0; // walks a\n\tvar j = 0; // walks b\n\tvar k = 0; // walks target M array\n\n\tvar mergedReturnStates = [];\n\tvar mergedParents = [];\n\t// walk and merge to yield mergedParents, mergedReturnStates\n\twhile (i < a.returnStates.length && j < b.returnStates.length) {\n\t\tvar a_parent = a.parents[i];\n\t\tvar b_parent = b.parents[j];\n\t\tif (a.returnStates[i] === b.returnStates[j]) {\n\t\t\t// same payload (stack tops are equal), must yield merged singleton\n\t\t\tvar payload = a.returnStates[i];\n\t\t\t// $+$ = $\n\t\t\tvar bothDollars = payload === PredictionContext.EMPTY_RETURN_STATE &&\n\t\t\t\t\ta_parent === null && b_parent === null;\n\t\t\tvar ax_ax = (a_parent !== null && b_parent !== null && a_parent === b_parent); // ax+ax\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// ->\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// ax\n\t\t\tif (bothDollars || ax_ax) {\n\t\t\t\tmergedParents[k] = a_parent; // choose left\n\t\t\t\tmergedReturnStates[k] = payload;\n\t\t\t} else { // ax+ay -> a'[x,y]\n\t\t\t\tvar mergedParent = merge(a_parent, b_parent, rootIsWildcard, mergeCache);\n\t\t\t\tmergedParents[k] = mergedParent;\n\t\t\t\tmergedReturnStates[k] = payload;\n\t\t\t}\n\t\t\ti += 1; // hop over left one as usual\n\t\t\tj += 1; // but also skip one in right side since we merge\n\t\t} else if (a.returnStates[i] < b.returnStates[j]) { // copy a[i] to M\n\t\t\tmergedParents[k] = a_parent;\n\t\t\tmergedReturnStates[k] = a.returnStates[i];\n\t\t\ti += 1;\n\t\t} else { // b > a, copy b[j] to M\n\t\t\tmergedParents[k] = b_parent;\n\t\t\tmergedReturnStates[k] = b.returnStates[j];\n\t\t\tj += 1;\n\t\t}\n\t\tk += 1;\n\t}\n\t// copy over any payloads remaining in either array\n\tif (i < a.returnStates.length) {\n\t\tfor (var p = i; p < a.returnStates.length; p++) {\n\t\t\tmergedParents[k] = a.parents[p];\n\t\t\tmergedReturnStates[k] = a.returnStates[p];\n\t\t\tk += 1;\n\t\t}\n\t} else {\n\t\tfor (var p = j; p < b.returnStates.length; p++) {\n\t\t\tmergedParents[k] = b.parents[p];\n\t\t\tmergedReturnStates[k] = b.returnStates[p];\n\t\t\tk += 1;\n\t\t}\n\t}\n\t// trim merged if we combined a few that had same stack tops\n\tif (k < mergedParents.length) { // write index < last position; trim\n\t\tif (k === 1) { // for just one merged element, return singleton top\n\t\t\tvar a_ = SingletonPredictionContext.create(mergedParents[0],\n\t\t\t\t\tmergedReturnStates[0]);\n\t\t\tif (mergeCache !== null) {\n\t\t\t\tmergeCache.set(a, b, a_);\n\t\t\t}\n\t\t\treturn a_;\n\t\t}\n\t\tmergedParents = mergedParents.slice(0, k);\n\t\tmergedReturnStates = mergedReturnStates.slice(0, k);\n\t}\n\n\tvar M = new ArrayPredictionContext(mergedParents, mergedReturnStates);\n\n\t// if we created same array as a or b, return that instead\n\t// TODO: track whether this is possible above during merge sort for speed\n\tif (M === a) {\n\t\tif (mergeCache !== null) {\n\t\t\tmergeCache.set(a, b, a);\n\t\t}\n\t\treturn a;\n\t}\n\tif (M === b) {\n\t\tif (mergeCache !== null) {\n\t\t\tmergeCache.set(a, b, b);\n\t\t}\n\t\treturn b;\n\t}\n\tcombineCommonParents(mergedParents);\n\n\tif (mergeCache !== null) {\n\t\tmergeCache.set(a, b, M);\n\t}\n\treturn M;\n}\n\n//\n// Make pass over all <em>M</em> {@code parents}; merge any {@code equals()}\n// ones.\n// /\nfunction combineCommonParents(parents) {\n\tvar uniqueParents = {};\n\n\tfor (var p = 0; p < parents.length; p++) {\n\t\tvar parent = parents[p];\n\t\tif (!(parent in uniqueParents)) {\n\t\t\tuniqueParents[parent] = parent;\n\t\t}\n\t}\n\tfor (var q = 0; q < parents.length; q++) {\n\t\tparents[q] = uniqueParents[parents[q]];\n\t}\n}\n\nfunction getCachedPredictionContext(context, contextCache, visited) {\n\tif (context.isEmpty()) {\n\t\treturn context;\n\t}\n\tvar existing = visited[context] || null;\n\tif (existing !== null) {\n\t\treturn existing;\n\t}\n\texisting = contextCache.get(context);\n\tif (existing !== null) {\n\t\tvisited[context] = existing;\n\t\treturn existing;\n\t}\n\tvar changed = false;\n\tvar parents = [];\n\tfor (var i = 0; i < parents.length; i++) {\n\t\tvar parent = getCachedPredictionContext(context.getParent(i), contextCache, visited);\n\t\tif (changed || parent !== context.getParent(i)) {\n\t\t\tif (!changed) {\n\t\t\t\tparents = [];\n\t\t\t\tfor (var j = 0; j < context.length; j++) {\n\t\t\t\t\tparents[j] = context.getParent(j);\n\t\t\t\t}\n\t\t\t\tchanged = true;\n\t\t\t}\n\t\t\tparents[i] = parent;\n\t\t}\n\t}\n\tif (!changed) {\n\t\tcontextCache.add(context);\n\t\tvisited[context] = context;\n\t\treturn context;\n\t}\n\tvar updated = null;\n\tif (parents.length === 0) {\n\t\tupdated = PredictionContext.EMPTY;\n\t} else if (parents.length === 1) {\n\t\tupdated = SingletonPredictionContext.create(parents[0], context\n\t\t\t\t.getReturnState(0));\n\t} else {\n\t\tupdated = new ArrayPredictionContext(parents, context.returnStates);\n\t}\n\tcontextCache.add(updated);\n\tvisited[updated] = updated;\n\tvisited[context] = updated;\n\n\treturn updated;\n}\n\n// ter's recursive version of Sam's getAllNodes()\nfunction getAllContextNodes(context, nodes, visited) {\n\tif (nodes === null) {\n\t\tnodes = [];\n\t\treturn getAllContextNodes(context, nodes, visited);\n\t} else if (visited === null) {\n\t\tvisited = {};\n\t\treturn getAllContextNodes(context, nodes, visited);\n\t} else {\n\t\tif (context === null || visited[context] !== null) {\n\t\t\treturn nodes;\n\t\t}\n\t\tvisited[context] = context;\n\t\tnodes.push(context);\n\t\tfor (var i = 0; i < context.length; i++) {\n\t\t\tgetAllContextNodes(context.getParent(i), nodes, visited);\n\t\t}\n\t\treturn nodes;\n\t}\n}\n\nexports.merge = merge;\nexports.PredictionContext = PredictionContext;\nexports.PredictionContextCache = PredictionContextCache;\nexports.SingletonPredictionContext = SingletonPredictionContext;\nexports.predictionContextFromRuleContext = predictionContextFromRuleContext;\nexports.getCachedPredictionContext = getCachedPredictionContext;\n","//\n/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n//\n\nvar Token = require('./Token').Token;\nvar ConsoleErrorListener = require('./error/ErrorListener').ConsoleErrorListener;\nvar ProxyErrorListener = require('./error/ErrorListener').ProxyErrorListener;\n\nfunction Recognizer() {\n    this._listeners = [ ConsoleErrorListener.INSTANCE ];\n    this._interp = null;\n    this._stateNumber = -1;\n    return this;\n}\n\nRecognizer.tokenTypeMapCache = {};\nRecognizer.ruleIndexMapCache = {};\n\n\nRecognizer.prototype.checkVersion = function(toolVersion) {\n    var runtimeVersion = \"4.7.1\";\n    if (runtimeVersion!==toolVersion) {\n        console.log(\"ANTLR runtime and generated code versions disagree: \"+runtimeVersion+\"!=\"+toolVersion);\n    }\n};\n\nRecognizer.prototype.addErrorListener = function(listener) {\n    this._listeners.push(listener);\n};\n\nRecognizer.prototype.removeErrorListeners = function() {\n    this._listeners = [];\n};\n\nRecognizer.prototype.getTokenTypeMap = function() {\n    var tokenNames = this.getTokenNames();\n    if (tokenNames===null) {\n        throw(\"The current recognizer does not provide a list of token names.\");\n    }\n    var result = this.tokenTypeMapCache[tokenNames];\n    if(result===undefined) {\n        result = tokenNames.reduce(function(o, k, i) { o[k] = i; });\n        result.EOF = Token.EOF;\n        this.tokenTypeMapCache[tokenNames] = result;\n    }\n    return result;\n};\n\n// Get a map from rule names to rule indexes.\n//\n// <p>Used for XPath and tree pattern compilation.</p>\n//\nRecognizer.prototype.getRuleIndexMap = function() {\n    var ruleNames = this.ruleNames;\n    if (ruleNames===null) {\n        throw(\"The current recognizer does not provide a list of rule names.\");\n    }\n    var result = this.ruleIndexMapCache[ruleNames];\n    if(result===undefined) {\n        result = ruleNames.reduce(function(o, k, i) { o[k] = i; });\n        this.ruleIndexMapCache[ruleNames] = result;\n    }\n    return result;\n};\n\nRecognizer.prototype.getTokenType = function(tokenName) {\n    var ttype = this.getTokenTypeMap()[tokenName];\n    if (ttype !==undefined) {\n        return ttype;\n    } else {\n        return Token.INVALID_TYPE;\n    }\n};\n\n\n// What is the error header, normally line/character position information?//\nRecognizer.prototype.getErrorHeader = function(e) {\n    var line = e.getOffendingToken().line;\n    var column = e.getOffendingToken().column;\n    return \"line \" + line + \":\" + column;\n};\n\n\n// How should a token be displayed in an error message? The default\n//  is to display just the text, but during development you might\n//  want to have a lot of information spit out.  Override in that case\n//  to use t.toString() (which, for CommonToken, dumps everything about\n//  the token). This is better than forcing you to override a method in\n//  your token objects because you don't have to go modify your lexer\n//  so that it creates a new Java type.\n//\n// @deprecated This method is not called by the ANTLR 4 Runtime. Specific\n// implementations of {@link ANTLRErrorStrategy} may provide a similar\n// feature when necessary. For example, see\n// {@link DefaultErrorStrategy//getTokenErrorDisplay}.\n//\nRecognizer.prototype.getTokenErrorDisplay = function(t) {\n    if (t===null) {\n        return \"<no token>\";\n    }\n    var s = t.text;\n    if (s===null) {\n        if (t.type===Token.EOF) {\n            s = \"<EOF>\";\n        } else {\n            s = \"<\" + t.type + \">\";\n        }\n    }\n    s = s.replace(\"\\n\",\"\\\\n\").replace(\"\\r\",\"\\\\r\").replace(\"\\t\",\"\\\\t\");\n    return \"'\" + s + \"'\";\n};\n\nRecognizer.prototype.getErrorListenerDispatch = function() {\n    return new ProxyErrorListener(this._listeners);\n};\n\n// subclass needs to override these if there are sempreds or actions\n// that the ATN interp needs to execute\nRecognizer.prototype.sempred = function(localctx, ruleIndex, actionIndex) {\n    return true;\n};\n\nRecognizer.prototype.precpred = function(localctx , precedence) {\n    return true;\n};\n\n//Indicate that the recognizer has changed internal state that is\n//consistent with the ATN state passed in.  This way we always know\n//where we are in the ATN as the parser goes along. The rule\n//context objects form a stack that lets us see the stack of\n//invoking rules. Combine this and we have complete ATN\n//configuration information.\n\nObject.defineProperty(Recognizer.prototype, \"state\", {\n\tget : function() {\n\t\treturn this._stateNumber;\n\t},\n\tset : function(state) {\n\t\tthis._stateNumber = state;\n\t}\n});\n\n\nexports.Recognizer = Recognizer;\n","/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n///\n\n//  A rule context is a record of a single rule invocation. It knows\n//  which context invoked it, if any. If there is no parent context, then\n//  naturally the invoking state is not valid.  The parent link\n//  provides a chain upwards from the current rule invocation to the root\n//  of the invocation tree, forming a stack. We actually carry no\n//  information about the rule associated with this context (except\n//  when parsing). We keep only the state number of the invoking state from\n//  the ATN submachine that invoked this. Contrast this with the s\n//  pointer inside ParserRuleContext that tracks the current state\n//  being \"executed\" for the current rule.\n//\n//  The parent contexts are useful for computing lookahead sets and\n//  getting error information.\n//\n//  These objects are used during parsing and prediction.\n//  For the special case of parsers, we use the subclass\n//  ParserRuleContext.\n//\n//  @see ParserRuleContext\n///\n\nvar RuleNode = require('./tree/Tree').RuleNode;\nvar INVALID_INTERVAL = require('./tree/Tree').INVALID_INTERVAL;\nvar INVALID_ALT_NUMBER = require('./atn/ATN').INVALID_ALT_NUMBER;\n\nfunction RuleContext(parent, invokingState) {\n\tRuleNode.call(this);\n\t// What context invoked this rule?\n\tthis.parentCtx = parent || null;\n\t// What state invoked the rule associated with this context?\n\t// The \"return address\" is the followState of invokingState\n\t// If parent is null, this should be -1.\n\tthis.invokingState = invokingState || -1;\n\treturn this;\n}\n\nRuleContext.prototype = Object.create(RuleNode.prototype);\nRuleContext.prototype.constructor = RuleContext;\n\nRuleContext.prototype.depth = function() {\n\tvar n = 0;\n\tvar p = this;\n\twhile (p !== null) {\n\t\tp = p.parentCtx;\n\t\tn += 1;\n\t}\n\treturn n;\n};\n\n// A context is empty if there is no invoking state; meaning nobody call\n// current context.\nRuleContext.prototype.isEmpty = function() {\n\treturn this.invokingState === -1;\n};\n\n// satisfy the ParseTree / SyntaxTree interface\n\nRuleContext.prototype.getSourceInterval = function() {\n\treturn INVALID_INTERVAL;\n};\n\nRuleContext.prototype.getRuleContext = function() {\n\treturn this;\n};\n\nRuleContext.prototype.getPayload = function() {\n\treturn this;\n};\n\n// Return the combined text of all child nodes. This method only considers\n// tokens which have been added to the parse tree.\n// <p>\n// Since tokens on hidden channels (e.g. whitespace or comments) are not\n// added to the parse trees, they will not appear in the output of this\n// method.\n// /\nRuleContext.prototype.getText = function() {\n\tif (this.getChildCount() === 0) {\n\t\treturn \"\";\n\t} else {\n\t\treturn this.children.map(function(child) {\n\t\t\treturn child.getText();\n\t\t}).join(\"\");\n\t}\n};\n\n// For rule associated with this parse tree internal node, return\n// the outer alternative number used to match the input. Default\n// implementation does not compute nor store this alt num. Create\n// a subclass of ParserRuleContext with backing field and set\n// option contextSuperClass.\n// to set it.\nRuleContext.prototype.getAltNumber = function() { return INVALID_ALT_NUMBER; }\n\n// Set the outer alternative number for this context node. Default\n// implementation does nothing to avoid backing field overhead for\n// trees that don't need it.  Create\n// a subclass of ParserRuleContext with backing field and set\n// option contextSuperClass.\nRuleContext.prototype.setAltNumber = function(altNumber) { }\n\nRuleContext.prototype.getChild = function(i) {\n\treturn null;\n};\n\nRuleContext.prototype.getChildCount = function() {\n\treturn 0;\n};\n\nRuleContext.prototype.accept = function(visitor) {\n\treturn visitor.visitChildren(this);\n};\n\n//need to manage circular dependencies, so export now\nexports.RuleContext = RuleContext;\nvar Trees = require('./tree/Trees').Trees;\n\n\n// Print out a whole tree, not just a node, in LISP format\n// (root child1 .. childN). Print just a node if this is a leaf.\n//\n\nRuleContext.prototype.toStringTree = function(ruleNames, recog) {\n\treturn Trees.toStringTree(this, ruleNames, recog);\n};\n\nRuleContext.prototype.toString = function(ruleNames, stop) {\n\truleNames = ruleNames || null;\n\tstop = stop || null;\n\tvar p = this;\n\tvar s = \"[\";\n\twhile (p !== null && p !== stop) {\n\t\tif (ruleNames === null) {\n\t\t\tif (!p.isEmpty()) {\n\t\t\t\ts += p.invokingState;\n\t\t\t}\n\t\t} else {\n\t\t\tvar ri = p.ruleIndex;\n\t\t\tvar ruleName = (ri >= 0 && ri < ruleNames.length) ? ruleNames[ri]\n\t\t\t\t\t: \"\" + ri;\n\t\t\ts += ruleName;\n\t\t}\n\t\tif (p.parentCtx !== null && (ruleNames !== null || !p.parentCtx.isEmpty())) {\n\t\t\ts += \" \";\n\t\t}\n\t\tp = p.parentCtx;\n\t}\n\ts += \"]\";\n\treturn s;\n};\n\n","/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n//\n\n// A token has properties: text, type, line, character position in the line\n// (so we can ignore tabs), token channel, index, and source from which\n// we obtained this token.\n\nfunction Token() {\n\tthis.source = null;\n\tthis.type = null; // token type of the token\n\tthis.channel = null; // The parser ignores everything not on DEFAULT_CHANNEL\n\tthis.start = null; // optional; return -1 if not implemented.\n\tthis.stop = null; // optional; return -1 if not implemented.\n\tthis.tokenIndex = null; // from 0..n-1 of the token object in the input stream\n\tthis.line = null; // line=1..n of the 1st character\n\tthis.column = null; // beginning of the line at which it occurs, 0..n-1\n\tthis._text = null; // text of the token.\n\treturn this;\n}\n\nToken.INVALID_TYPE = 0;\n\n// During lookahead operations, this \"token\" signifies we hit rule end ATN state\n// and did not follow it despite needing to.\nToken.EPSILON = -2;\n\nToken.MIN_USER_TOKEN_TYPE = 1;\n\nToken.EOF = -1;\n\n// All tokens go to the parser (unless skip() is called in that rule)\n// on a particular \"channel\". The parser tunes to a particular channel\n// so that whitespace etc... can go to the parser on a \"hidden\" channel.\n\nToken.DEFAULT_CHANNEL = 0;\n\n// Anything on different channel than DEFAULT_CHANNEL is not parsed\n// by parser.\n\nToken.HIDDEN_CHANNEL = 1;\n\n// Explicitly set the text for this token. If {code text} is not\n// {@code null}, then {@link //getText} will return this value rather than\n// extracting the text from the input.\n//\n// @param text The explicit text of the token, or {@code null} if the text\n// should be obtained from the input along with the start and stop indexes\n// of the token.\n\nObject.defineProperty(Token.prototype, \"text\", {\n\tget : function() {\n\t\treturn this._text;\n\t},\n\tset : function(text) {\n\t\tthis._text = text;\n\t}\n});\n\nToken.prototype.getTokenSource = function() {\n\treturn this.source[0];\n};\n\nToken.prototype.getInputStream = function() {\n\treturn this.source[1];\n};\n\nfunction CommonToken(source, type, channel, start, stop) {\n\tToken.call(this);\n\tthis.source = source !== undefined ? source : CommonToken.EMPTY_SOURCE;\n\tthis.type = type !== undefined ? type : null;\n\tthis.channel = channel !== undefined ? channel : Token.DEFAULT_CHANNEL;\n\tthis.start = start !== undefined ? start : -1;\n\tthis.stop = stop !== undefined ? stop : -1;\n\tthis.tokenIndex = -1;\n\tif (this.source[0] !== null) {\n\t\tthis.line = source[0].line;\n\t\tthis.column = source[0].column;\n\t} else {\n\t\tthis.column = -1;\n\t}\n\treturn this;\n}\n\nCommonToken.prototype = Object.create(Token.prototype);\nCommonToken.prototype.constructor = CommonToken;\n\n// An empty {@link Pair} which is used as the default value of\n// {@link //source} for tokens that do not have a source.\nCommonToken.EMPTY_SOURCE = [ null, null ];\n\n// Constructs a new {@link CommonToken} as a copy of another {@link Token}.\n//\n// <p>\n// If {@code oldToken} is also a {@link CommonToken} instance, the newly\n// constructed token will share a reference to the {@link //text} field and\n// the {@link Pair} stored in {@link //source}. Otherwise, {@link //text} will\n// be assigned the result of calling {@link //getText}, and {@link //source}\n// will be constructed from the result of {@link Token//getTokenSource} and\n// {@link Token//getInputStream}.</p>\n//\n// @param oldToken The token to copy.\n//\nCommonToken.prototype.clone = function() {\n\tvar t = new CommonToken(this.source, this.type, this.channel, this.start,\n\t\t\tthis.stop);\n\tt.tokenIndex = this.tokenIndex;\n\tt.line = this.line;\n\tt.column = this.column;\n\tt.text = this.text;\n\treturn t;\n};\n\nObject.defineProperty(CommonToken.prototype, \"text\", {\n\tget : function() {\n\t\tif (this._text !== null) {\n\t\t\treturn this._text;\n\t\t}\n\t\tvar input = this.getInputStream();\n\t\tif (input === null) {\n\t\t\treturn null;\n\t\t}\n\t\tvar n = input.size;\n\t\tif (this.start < n && this.stop < n) {\n\t\t\treturn input.getText(this.start, this.stop);\n\t\t} else {\n\t\t\treturn \"<EOF>\";\n\t\t}\n\t},\n\tset : function(text) {\n\t\tthis._text = text;\n\t}\n});\n\nCommonToken.prototype.toString = function() {\n\tvar txt = this.text;\n\tif (txt !== null) {\n\t\ttxt = txt.replace(/\\n/g, \"\\\\n\").replace(/\\r/g, \"\\\\r\").replace(/\\t/g, \"\\\\t\");\n\t} else {\n\t\ttxt = \"<no text>\";\n\t}\n\treturn \"[@\" + this.tokenIndex + \",\" + this.start + \":\" + this.stop + \"='\" +\n\t\t\ttxt + \"',<\" + this.type + \">\" +\n\t\t\t(this.channel > 0 ? \",channel=\" + this.channel : \"\") + \",\" +\n\t\t\tthis.line + \":\" + this.column + \"]\";\n};\n\nexports.Token = Token;\nexports.CommonToken = CommonToken;\n","/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n\nfunction arrayToString(a) {\n    return \"[\" + a.join(\", \") + \"]\";\n}\n\nString.prototype.seed = String.prototype.seed || Math.round(Math.random() * Math.pow(2, 32));\n\nString.prototype.hashCode = function () {\n    var remainder, bytes, h1, h1b, c1, c1b, c2, c2b, k1, i,\n        key = this.toString();\n\n    remainder = key.length & 3; // key.length % 4\n    bytes = key.length - remainder;\n    h1 = String.prototype.seed;\n    c1 = 0xcc9e2d51;\n    c2 = 0x1b873593;\n    i = 0;\n\n    while (i < bytes) {\n        k1 =\n            ((key.charCodeAt(i) & 0xff)) |\n            ((key.charCodeAt(++i) & 0xff) << 8) |\n            ((key.charCodeAt(++i) & 0xff) << 16) |\n            ((key.charCodeAt(++i) & 0xff) << 24);\n        ++i;\n\n        k1 = ((((k1 & 0xffff) * c1) + ((((k1 >>> 16) * c1) & 0xffff) << 16))) & 0xffffffff;\n        k1 = (k1 << 15) | (k1 >>> 17);\n        k1 = ((((k1 & 0xffff) * c2) + ((((k1 >>> 16) * c2) & 0xffff) << 16))) & 0xffffffff;\n\n        h1 ^= k1;\n        h1 = (h1 << 13) | (h1 >>> 19);\n        h1b = ((((h1 & 0xffff) * 5) + ((((h1 >>> 16) * 5) & 0xffff) << 16))) & 0xffffffff;\n        h1 = (((h1b & 0xffff) + 0x6b64) + ((((h1b >>> 16) + 0xe654) & 0xffff) << 16));\n    }\n\n    k1 = 0;\n\n    switch (remainder) {\n        case 3:\n            k1 ^= (key.charCodeAt(i + 2) & 0xff) << 16;\n        case 2:\n            k1 ^= (key.charCodeAt(i + 1) & 0xff) << 8;\n        case 1:\n            k1 ^= (key.charCodeAt(i) & 0xff);\n\n            k1 = (((k1 & 0xffff) * c1) + ((((k1 >>> 16) * c1) & 0xffff) << 16)) & 0xffffffff;\n            k1 = (k1 << 15) | (k1 >>> 17);\n            k1 = (((k1 & 0xffff) * c2) + ((((k1 >>> 16) * c2) & 0xffff) << 16)) & 0xffffffff;\n            h1 ^= k1;\n    }\n\n    h1 ^= key.length;\n\n    h1 ^= h1 >>> 16;\n    h1 = (((h1 & 0xffff) * 0x85ebca6b) + ((((h1 >>> 16) * 0x85ebca6b) & 0xffff) << 16)) & 0xffffffff;\n    h1 ^= h1 >>> 13;\n    h1 = ((((h1 & 0xffff) * 0xc2b2ae35) + ((((h1 >>> 16) * 0xc2b2ae35) & 0xffff) << 16))) & 0xffffffff;\n    h1 ^= h1 >>> 16;\n\n    return h1 >>> 0;\n};\n\nfunction standardEqualsFunction(a, b) {\n    return a.equals(b);\n}\n\nfunction standardHashCodeFunction(a) {\n    return a.hashCode();\n}\n\nfunction Set(hashFunction, equalsFunction) {\n    this.data = {};\n    this.hashFunction = hashFunction || standardHashCodeFunction;\n    this.equalsFunction = equalsFunction || standardEqualsFunction;\n    return this;\n}\n\nObject.defineProperty(Set.prototype, \"length\", {\n    get: function () {\n        var l = 0;\n        for (var key in this.data) {\n            if (key.indexOf(\"hash_\") === 0) {\n                l = l + this.data[key].length;\n            }\n        }\n        return l;\n    }\n});\n\nSet.prototype.add = function (value) {\n    var hash = this.hashFunction(value);\n    var key = \"hash_\" + hash;\n    if (key in this.data) {\n        var values = this.data[key];\n        for (var i = 0; i < values.length; i++) {\n            if (this.equalsFunction(value, values[i])) {\n                return values[i];\n            }\n        }\n        values.push(value);\n        return value;\n    } else {\n        this.data[key] = [value];\n        return value;\n    }\n};\n\nSet.prototype.contains = function (value) {\n    return this.get(value) != null;\n};\n\nSet.prototype.get = function (value) {\n    var hash = this.hashFunction(value);\n    var key = \"hash_\" + hash;\n    if (key in this.data) {\n        var values = this.data[key];\n        for (var i = 0; i < values.length; i++) {\n            if (this.equalsFunction(value, values[i])) {\n                return values[i];\n            }\n        }\n    }\n    return null;\n};\n\nSet.prototype.values = function () {\n    var l = [];\n    for (var key in this.data) {\n        if (key.indexOf(\"hash_\") === 0) {\n            l = l.concat(this.data[key]);\n        }\n    }\n    return l;\n};\n\nSet.prototype.toString = function () {\n    return arrayToString(this.values());\n};\n\nfunction BitSet() {\n    this.data = [];\n    return this;\n}\n\nBitSet.prototype.add = function (value) {\n    this.data[value] = true;\n};\n\nBitSet.prototype.or = function (set) {\n    var bits = this;\n    Object.keys(set.data).map(function (alt) {\n        bits.add(alt);\n    });\n};\n\nBitSet.prototype.remove = function (value) {\n    delete this.data[value];\n};\n\nBitSet.prototype.contains = function (value) {\n    return this.data[value] === true;\n};\n\nBitSet.prototype.values = function () {\n    return Object.keys(this.data);\n};\n\nBitSet.prototype.minValue = function () {\n    return Math.min.apply(null, this.values());\n};\n\nBitSet.prototype.hashCode = function () {\n    var hash = new Hash();\n    hash.update(this.values());\n    return hash.finish();\n};\n\nBitSet.prototype.equals = function (other) {\n    if (!(other instanceof BitSet)) {\n        return false;\n    }\n    return this.hashCode() === other.hashCode();\n};\n\nObject.defineProperty(BitSet.prototype, \"length\", {\n    get: function () {\n        return this.values().length;\n    }\n});\n\nBitSet.prototype.toString = function () {\n    return \"{\" + this.values().join(\", \") + \"}\";\n};\n\nfunction Map(hashFunction, equalsFunction) {\n    this.data = {};\n    this.hashFunction = hashFunction || standardHashCodeFunction;\n    this.equalsFunction = equalsFunction || standardEqualsFunction;\n    return this;\n}\n\nObject.defineProperty(Map.prototype, \"length\", {\n    get: function () {\n        var l = 0;\n        for (var hashKey in this.data) {\n            if (hashKey.indexOf(\"hash_\") === 0) {\n                l = l + this.data[hashKey].length;\n            }\n        }\n        return l;\n    }\n});\n\nMap.prototype.put = function (key, value) {\n    var hashKey = \"hash_\" + this.hashFunction(key);\n    if (hashKey in this.data) {\n        var entries = this.data[hashKey];\n        for (var i = 0; i < entries.length; i++) {\n            var entry = entries[i];\n            if (this.equalsFunction(key, entry.key)) {\n                var oldValue = entry.value;\n                entry.value = value;\n                return oldValue;\n            }\n        }\n        entries.push({key:key, value:value});\n        return value;\n    } else {\n        this.data[hashKey] = [{key:key, value:value}];\n        return value;\n    }\n};\n\nMap.prototype.containsKey = function (key) {\n    var hashKey = \"hash_\" + this.hashFunction(key);\n    if(hashKey in this.data) {\n        var entries = this.data[hashKey];\n        for (var i = 0; i < entries.length; i++) {\n            var entry = entries[i];\n            if (this.equalsFunction(key, entry.key))\n                return true;\n        }\n    }\n    return false;\n};\n\nMap.prototype.get = function (key) {\n    var hashKey = \"hash_\" + this.hashFunction(key);\n    if(hashKey in this.data) {\n        var entries = this.data[hashKey];\n        for (var i = 0; i < entries.length; i++) {\n            var entry = entries[i];\n            if (this.equalsFunction(key, entry.key))\n                return entry.value;\n        }\n    }\n    return null;\n};\n\nMap.prototype.entries = function () {\n    var l = [];\n    for (var key in this.data) {\n        if (key.indexOf(\"hash_\") === 0) {\n            l = l.concat(this.data[key]);\n        }\n    }\n    return l;\n};\n\n\nMap.prototype.getKeys = function () {\n    return this.entries().map(function(e) {\n        return e.key;\n    });\n};\n\n\nMap.prototype.getValues = function () {\n    return this.entries().map(function(e) {\n            return e.value;\n    });\n};\n\n\nMap.prototype.toString = function () {\n    var ss = this.entries().map(function(entry) {\n        return '{' + entry.key + ':' + entry.value + '}';\n    });\n    return '[' + ss.join(\", \") + ']';\n};\n\n\nfunction AltDict() {\n    this.data = {};\n    return this;\n}\n\n\nAltDict.prototype.get = function (key) {\n    key = \"k-\" + key;\n    if (key in this.data) {\n        return this.data[key];\n    } else {\n        return null;\n    }\n};\n\nAltDict.prototype.put = function (key, value) {\n    key = \"k-\" + key;\n    this.data[key] = value;\n};\n\nAltDict.prototype.values = function () {\n    var data = this.data;\n    var keys = Object.keys(this.data);\n    return keys.map(function (key) {\n        return data[key];\n    });\n};\n\nfunction DoubleDict() {\n    return this;\n}\n\nfunction Hash() {\n    this.count = 0;\n    this.hash = 0;\n    return this;\n}\n\nHash.prototype.update = function () {\n    for(var i=0;i<arguments.length;i++) {\n        var value = arguments[i];\n        if (value == null)\n            continue;\n        if(Array.isArray(value))\n            this.update.apply(value);\n        else {\n            var k = 0;\n            switch (typeof(value)) {\n                case 'undefined':\n                case 'function':\n                    continue;\n                case 'number':\n                case 'boolean':\n                    k = value;\n                    break;\n                case 'string':\n                    k = value.hashCode();\n                    break;\n                default:\n                    value.updateHashCode(this);\n                    continue;\n            }\n            k = k * 0xCC9E2D51;\n            k = (k << 15) | (k >>> (32 - 15));\n            k = k * 0x1B873593;\n            this.count = this.count + 1;\n            var hash = this.hash ^ k;\n            hash = (hash << 13) | (hash >>> (32 - 13));\n            hash = hash * 5 + 0xE6546B64;\n            this.hash = hash;\n        }\n    }\n}\n\nHash.prototype.finish = function () {\n    var hash = this.hash ^ (this.count * 4);\n    hash = hash ^ (hash >>> 16);\n    hash = hash * 0x85EBCA6B;\n    hash = hash ^ (hash >>> 13);\n    hash = hash * 0xC2B2AE35;\n    hash = hash ^ (hash >>> 16);\n    return hash;\n}\n\nfunction hashStuff() {\n    var hash = new Hash();\n    hash.update.apply(arguments);\n    return hash.finish();\n}\n\nDoubleDict.prototype.get = function (a, b) {\n    var d = this[a] || null;\n    return d === null ? null : (d[b] || null);\n};\n\nDoubleDict.prototype.set = function (a, b, o) {\n    var d = this[a] || null;\n    if (d === null) {\n        d = {};\n        this[a] = d;\n    }\n    d[b] = o;\n};\n\n\nfunction escapeWhitespace(s, escapeSpaces) {\n    s = s.replace(/\\t/g, \"\\\\t\")\n         .replace(/\\n/g, \"\\\\n\")\n         .replace(/\\r/g, \"\\\\r\");\n    if (escapeSpaces) {\n        s = s.replace(/ /g, \"\\u00B7\");\n    }\n    return s;\n}\n\nfunction titleCase(str) {\n    return str.replace(/\\w\\S*/g, function (txt) {\n        return txt.charAt(0).toUpperCase() + txt.substr(1);\n    });\n};\n\nfunction equalArrays(a, b)\n{\n    if (!Array.isArray(a) || !Array.isArray(b))\n        return false;\n    if (a == b)\n        return true;\n    if (a.length != b.length)\n        return false;\n    for (var i = 0; i < a.length; i++) {\n        if (a[i] == b[i])\n            continue;\n        if (!a[i].equals(b[i]))\n            return false;\n    }\n    return true;\n};\n\nexports.Hash = Hash;\nexports.Set = Set;\nexports.Map = Map;\nexports.BitSet = BitSet;\nexports.AltDict = AltDict;\nexports.DoubleDict = DoubleDict;\nexports.hashStuff = hashStuff;\nexports.escapeWhitespace = escapeWhitespace;\nexports.arrayToString = arrayToString;\nexports.titleCase = titleCase;\nexports.equalArrays = equalArrays;\n","/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n\nvar LL1Analyzer = require('./../LL1Analyzer').LL1Analyzer;\nvar IntervalSet = require('./../IntervalSet').IntervalSet;\n\nfunction ATN(grammarType , maxTokenType) {\n\n    // Used for runtime deserialization of ATNs from strings///\n    // The type of the ATN.\n    this.grammarType = grammarType;\n    // The maximum value for any symbol recognized by a transition in the ATN.\n    this.maxTokenType = maxTokenType;\n    this.states = [];\n    // Each subrule/rule is a decision point and we must track them so we\n    //  can go back later and build DFA predictors for them.  This includes\n    //  all the rules, subrules, optional blocks, ()+, ()* etc...\n    this.decisionToState = [];\n    // Maps from rule index to starting state number.\n    this.ruleToStartState = [];\n    // Maps from rule index to stop state number.\n    this.ruleToStopState = null;\n    this.modeNameToStartState = {};\n    // For lexer ATNs, this maps the rule index to the resulting token type.\n    // For parser ATNs, this maps the rule index to the generated bypass token\n    // type if the\n    // {@link ATNDeserializationOptions//isGenerateRuleBypassTransitions}\n    // deserialization option was specified; otherwise, this is {@code null}.\n    this.ruleToTokenType = null;\n    // For lexer ATNs, this is an array of {@link LexerAction} objects which may\n    // be referenced by action transitions in the ATN.\n    this.lexerActions = null;\n    this.modeToStartState = [];\n\n    return this;\n}\n\n// Compute the set of valid tokens that can occur starting in state {@code s}.\n//  If {@code ctx} is null, the set of tokens will not include what can follow\n//  the rule surrounding {@code s}. In other words, the set will be\n//  restricted to tokens reachable staying within {@code s}'s rule.\nATN.prototype.nextTokensInContext = function(s, ctx) {\n    var anal = new LL1Analyzer(this);\n    return anal.LOOK(s, null, ctx);\n};\n\n// Compute the set of valid tokens that can occur starting in {@code s} and\n// staying in same rule. {@link Token//EPSILON} is in set if we reach end of\n// rule.\nATN.prototype.nextTokensNoContext = function(s) {\n    if (s.nextTokenWithinRule !== null ) {\n        return s.nextTokenWithinRule;\n    }\n    s.nextTokenWithinRule = this.nextTokensInContext(s, null);\n    s.nextTokenWithinRule.readOnly = true;\n    return s.nextTokenWithinRule;\n};\n\nATN.prototype.nextTokens = function(s, ctx) {\n    if ( ctx===undefined ) {\n        return this.nextTokensNoContext(s);\n    } else {\n        return this.nextTokensInContext(s, ctx);\n    }\n};\n\nATN.prototype.addState = function( state) {\n    if ( state !== null ) {\n        state.atn = this;\n        state.stateNumber = this.states.length;\n    }\n    this.states.push(state);\n};\n\nATN.prototype.removeState = function( state) {\n    this.states[state.stateNumber] = null; // just free mem, don't shift states in list\n};\n\nATN.prototype.defineDecisionState = function( s) {\n    this.decisionToState.push(s);\n    s.decision = this.decisionToState.length-1;\n    return s.decision;\n};\n\nATN.prototype.getDecisionState = function( decision) {\n    if (this.decisionToState.length===0) {\n        return null;\n    } else {\n        return this.decisionToState[decision];\n    }\n};\n\n// Computes the set of input symbols which could follow ATN state number\n// {@code stateNumber} in the specified full {@code context}. This method\n// considers the complete parser context, but does not evaluate semantic\n// predicates (i.e. all predicates encountered during the calculation are\n// assumed true). If a path in the ATN exists from the starting state to the\n// {@link RuleStopState} of the outermost context without matching any\n// symbols, {@link Token//EOF} is added to the returned set.\n//\n// <p>If {@code context} is {@code null}, it is treated as\n// {@link ParserRuleContext//EMPTY}.</p>\n//\n// @param stateNumber the ATN state number\n// @param context the full parse context\n// @return The set of potentially valid input symbols which could follow the\n// specified state in the specified context.\n// @throws IllegalArgumentException if the ATN does not contain a state with\n// number {@code stateNumber}\nvar Token = require('./../Token').Token;\n\nATN.prototype.getExpectedTokens = function( stateNumber, ctx ) {\n    if ( stateNumber < 0 || stateNumber >= this.states.length ) {\n        throw(\"Invalid state number.\");\n    }\n    var s = this.states[stateNumber];\n    var following = this.nextTokens(s);\n    if (!following.contains(Token.EPSILON)) {\n        return following;\n    }\n    var expected = new IntervalSet();\n    expected.addSet(following);\n    expected.removeOne(Token.EPSILON);\n    while (ctx !== null && ctx.invokingState >= 0 && following.contains(Token.EPSILON)) {\n        var invokingState = this.states[ctx.invokingState];\n        var rt = invokingState.transitions[0];\n        following = this.nextTokens(rt.followState);\n        expected.addSet(following);\n        expected.removeOne(Token.EPSILON);\n        ctx = ctx.parentCtx;\n    }\n    if (following.contains(Token.EPSILON)) {\n        expected.addOne(Token.EOF);\n    }\n    return expected;\n};\n\nATN.INVALID_ALT_NUMBER = 0;\n\nexports.ATN = ATN;","//\n/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n///\n\n// A tuple: (ATN state, predicted alt, syntactic, semantic context).\n//  The syntactic context is a graph-structured stack node whose\n//  path(s) to the root is the rule invocation(s)\n//  chain used to arrive at the state.  The semantic context is\n//  the tree of semantic predicates encountered before reaching\n//  an ATN state.\n///\n\nvar DecisionState = require('./ATNState').DecisionState;\nvar SemanticContext = require('./SemanticContext').SemanticContext;\nvar Hash = require(\"../Utils\").Hash;\n\n\nfunction checkParams(params, isCfg) {\n\tif(params===null) {\n\t\tvar result = { state:null, alt:null, context:null, semanticContext:null };\n\t\tif(isCfg) {\n\t\t\tresult.reachesIntoOuterContext = 0;\n\t\t}\n\t\treturn result;\n\t} else {\n\t\tvar props = {};\n\t\tprops.state = params.state || null;\n\t\tprops.alt = (params.alt === undefined) ? null : params.alt;\n\t\tprops.context = params.context || null;\n\t\tprops.semanticContext = params.semanticContext || null;\n\t\tif(isCfg) {\n\t\t\tprops.reachesIntoOuterContext = params.reachesIntoOuterContext || 0;\n\t\t\tprops.precedenceFilterSuppressed = params.precedenceFilterSuppressed || false;\n\t\t}\n\t\treturn props;\n\t}\n}\n\nfunction ATNConfig(params, config) {\n\tthis.checkContext(params, config);\n\tparams = checkParams(params);\n\tconfig = checkParams(config, true);\n    // The ATN state associated with this configuration///\n    this.state = params.state!==null ? params.state : config.state;\n    // What alt (or lexer rule) is predicted by this configuration///\n    this.alt = params.alt!==null ? params.alt : config.alt;\n    // The stack of invoking states leading to the rule/states associated\n    //  with this config.  We track only those contexts pushed during\n    //  execution of the ATN simulator.\n    this.context = params.context!==null ? params.context : config.context;\n    this.semanticContext = params.semanticContext!==null ? params.semanticContext :\n        (config.semanticContext!==null ? config.semanticContext : SemanticContext.NONE);\n    // We cannot execute predicates dependent upon local context unless\n    // we know for sure we are in the correct context. Because there is\n    // no way to do this efficiently, we simply cannot evaluate\n    // dependent predicates unless we are in the rule that initially\n    // invokes the ATN simulator.\n    //\n    // closure() tracks the depth of how far we dip into the\n    // outer context: depth &gt; 0.  Note that it may not be totally\n    // accurate depth since I don't ever decrement. TODO: make it a boolean then\n    this.reachesIntoOuterContext = config.reachesIntoOuterContext;\n    this.precedenceFilterSuppressed = config.precedenceFilterSuppressed;\n    return this;\n}\n\nATNConfig.prototype.checkContext = function(params, config) {\n\tif((params.context===null || params.context===undefined) &&\n\t\t\t(config===null || config.context===null || config.context===undefined)) {\n\t\tthis.context = null;\n\t}\n};\n\n\nATNConfig.prototype.hashCode = function() {\n    var hash = new Hash();\n    this.updateHashCode(hash);\n    return hash.finish();\n};\n\n\nATNConfig.prototype.updateHashCode = function(hash) {\n    hash.update(this.state.stateNumber, this.alt, this.context, this.semanticContext);\n};\n\n// An ATN configuration is equal to another if both have\n//  the same state, they predict the same alternative, and\n//  syntactic/semantic contexts are the same.\n\nATNConfig.prototype.equals = function(other) {\n    if (this === other) {\n        return true;\n    } else if (! (other instanceof ATNConfig)) {\n        return false;\n    } else {\n        return this.state.stateNumber===other.state.stateNumber &&\n            this.alt===other.alt &&\n            (this.context===null ? other.context===null : this.context.equals(other.context)) &&\n            this.semanticContext.equals(other.semanticContext) &&\n            this.precedenceFilterSuppressed===other.precedenceFilterSuppressed;\n    }\n};\n\n\nATNConfig.prototype.hashCodeForConfigSet = function() {\n    var hash = new Hash();\n    hash.update(this.state.stateNumber, this.alt, this.semanticContext);\n    return hash.finish();\n};\n\n\nATNConfig.prototype.equalsForConfigSet = function(other) {\n    if (this === other) {\n        return true;\n    } else if (! (other instanceof ATNConfig)) {\n        return false;\n    } else {\n        return this.state.stateNumber===other.state.stateNumber &&\n            this.alt===other.alt &&\n            this.semanticContext.equals(other.semanticContext);\n    }\n};\n\n\nATNConfig.prototype.toString = function() {\n    return \"(\" + this.state + \",\" + this.alt +\n        (this.context!==null ? \",[\" + this.context.toString() + \"]\" : \"\") +\n        (this.semanticContext !== SemanticContext.NONE ?\n                (\",\" + this.semanticContext.toString())\n                : \"\") +\n        (this.reachesIntoOuterContext>0 ?\n                (\",up=\" + this.reachesIntoOuterContext)\n                : \"\") + \")\";\n};\n\n\nfunction LexerATNConfig(params, config) {\n\tATNConfig.call(this, params, config);\n\n    // This is the backing field for {@link //getLexerActionExecutor}.\n\tvar lexerActionExecutor = params.lexerActionExecutor || null;\n    this.lexerActionExecutor = lexerActionExecutor || (config!==null ? config.lexerActionExecutor : null);\n    this.passedThroughNonGreedyDecision = config!==null ? this.checkNonGreedyDecision(config, this.state) : false;\n    return this;\n}\n\nLexerATNConfig.prototype = Object.create(ATNConfig.prototype);\nLexerATNConfig.prototype.constructor = LexerATNConfig;\n\nLexerATNConfig.prototype.updateHashCode = function(hash) {\n    hash.update(this.state.stateNumber, this.alt, this.context, this.semanticContext, this.passedThroughNonGreedyDecision, this.lexerActionExecutor);\n};\n\nLexerATNConfig.prototype.equals = function(other) {\n    return this === other ||\n            (other instanceof LexerATNConfig &&\n            this.passedThroughNonGreedyDecision == other.passedThroughNonGreedyDecision &&\n            (this.lexerActionExecutor ? this.lexerActionExecutor.equals(other.lexerActionExecutor) : !other.lexerActionExecutor) &&\n            ATNConfig.prototype.equals.call(this, other));\n};\n\nLexerATNConfig.prototype.hashCodeForConfigSet = LexerATNConfig.prototype.hashCode;\n\nLexerATNConfig.prototype.equalsForConfigSet = LexerATNConfig.prototype.equals;\n\n\nLexerATNConfig.prototype.checkNonGreedyDecision = function(source, target) {\n    return source.passedThroughNonGreedyDecision ||\n        (target instanceof DecisionState) && target.nonGreedy;\n};\n\nexports.ATNConfig = ATNConfig;\nexports.LexerATNConfig = LexerATNConfig;","//\n/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n\n//\n// Specialized {@link Set}{@code <}{@link ATNConfig}{@code >} that can track\n// info about the set, with support for combining similar configurations using a\n// graph-structured stack.\n///\n\nvar ATN = require('./ATN').ATN;\nvar Utils = require('./../Utils');\nvar Hash = Utils.Hash;\nvar Set = Utils.Set;\nvar SemanticContext = require('./SemanticContext').SemanticContext;\nvar merge = require('./../PredictionContext').merge;\n\nfunction hashATNConfig(c) {\n\treturn c.hashCodeForConfigSet();\n}\n\nfunction equalATNConfigs(a, b) {\n\tif ( a===b ) {\n\t\treturn true;\n\t} else if ( a===null || b===null ) {\n\t\treturn false;\n\t} else\n       return a.equalsForConfigSet(b);\n }\n\n\nfunction ATNConfigSet(fullCtx) {\n\t//\n\t// The reason that we need this is because we don't want the hash map to use\n\t// the standard hash code and equals. We need all configurations with the\n\t// same\n\t// {@code (s,i,_,semctx)} to be equal. Unfortunately, this key effectively\n\t// doubles\n\t// the number of objects associated with ATNConfigs. The other solution is\n\t// to\n\t// use a hash table that lets us specify the equals/hashcode operation.\n\t// All configs but hashed by (s, i, _, pi) not including context. Wiped out\n\t// when we go readonly as this set becomes a DFA state.\n\tthis.configLookup = new Set(hashATNConfig, equalATNConfigs);\n\t// Indicates that this configuration set is part of a full context\n\t// LL prediction. It will be used to determine how to merge $. With SLL\n\t// it's a wildcard whereas it is not for LL context merge.\n\tthis.fullCtx = fullCtx === undefined ? true : fullCtx;\n\t// Indicates that the set of configurations is read-only. Do not\n\t// allow any code to manipulate the set; DFA states will point at\n\t// the sets and they must not change. This does not protect the other\n\t// fields; in particular, conflictingAlts is set after\n\t// we've made this readonly.\n\tthis.readOnly = false;\n\t// Track the elements as they are added to the set; supports get(i)///\n\tthis.configs = [];\n\n\t// TODO: these fields make me pretty uncomfortable but nice to pack up info\n\t// together, saves recomputation\n\t// TODO: can we track conflicts as they are added to save scanning configs\n\t// later?\n\tthis.uniqueAlt = 0;\n\tthis.conflictingAlts = null;\n\n\t// Used in parser and lexer. In lexer, it indicates we hit a pred\n\t// while computing a closure operation. Don't make a DFA state from this.\n\tthis.hasSemanticContext = false;\n\tthis.dipsIntoOuterContext = false;\n\n\tthis.cachedHashCode = -1;\n\n\treturn this;\n}\n\n// Adding a new config means merging contexts with existing configs for\n// {@code (s, i, pi, _)}, where {@code s} is the\n// {@link ATNConfig//state}, {@code i} is the {@link ATNConfig//alt}, and\n// {@code pi} is the {@link ATNConfig//semanticContext}. We use\n// {@code (s,i,pi)} as key.\n//\n// <p>This method updates {@link //dipsIntoOuterContext} and\n// {@link //hasSemanticContext} when necessary.</p>\n// /\nATNConfigSet.prototype.add = function(config, mergeCache) {\n\tif (mergeCache === undefined) {\n\t\tmergeCache = null;\n\t}\n\tif (this.readOnly) {\n\t\tthrow \"This set is readonly\";\n\t}\n\tif (config.semanticContext !== SemanticContext.NONE) {\n\t\tthis.hasSemanticContext = true;\n\t}\n\tif (config.reachesIntoOuterContext > 0) {\n\t\tthis.dipsIntoOuterContext = true;\n\t}\n\tvar existing = this.configLookup.add(config);\n\tif (existing === config) {\n\t\tthis.cachedHashCode = -1;\n\t\tthis.configs.push(config); // track order here\n\t\treturn true;\n\t}\n\t// a previous (s,i,pi,_), merge with it and save result\n\tvar rootIsWildcard = !this.fullCtx;\n\tvar merged = merge(existing.context, config.context, rootIsWildcard, mergeCache);\n\t// no need to check for existing.context, config.context in cache\n\t// since only way to create new graphs is \"call rule\" and here. We\n\t// cache at both places.\n\texisting.reachesIntoOuterContext = Math.max( existing.reachesIntoOuterContext, config.reachesIntoOuterContext);\n\t// make sure to preserve the precedence filter suppression during the merge\n\tif (config.precedenceFilterSuppressed) {\n\t\texisting.precedenceFilterSuppressed = true;\n\t}\n\texisting.context = merged; // replace context; no need to alt mapping\n\treturn true;\n};\n\nATNConfigSet.prototype.getStates = function() {\n\tvar states = new Set();\n\tfor (var i = 0; i < this.configs.length; i++) {\n\t\tstates.add(this.configs[i].state);\n\t}\n\treturn states;\n};\n\nATNConfigSet.prototype.getPredicates = function() {\n\tvar preds = [];\n\tfor (var i = 0; i < this.configs.length; i++) {\n\t\tvar c = this.configs[i].semanticContext;\n\t\tif (c !== SemanticContext.NONE) {\n\t\t\tpreds.push(c.semanticContext);\n\t\t}\n\t}\n\treturn preds;\n};\n\nObject.defineProperty(ATNConfigSet.prototype, \"items\", {\n\tget : function() {\n\t\treturn this.configs;\n\t}\n});\n\nATNConfigSet.prototype.optimizeConfigs = function(interpreter) {\n\tif (this.readOnly) {\n\t\tthrow \"This set is readonly\";\n\t}\n\tif (this.configLookup.length === 0) {\n\t\treturn;\n\t}\n\tfor (var i = 0; i < this.configs.length; i++) {\n\t\tvar config = this.configs[i];\n\t\tconfig.context = interpreter.getCachedContext(config.context);\n\t}\n};\n\nATNConfigSet.prototype.addAll = function(coll) {\n\tfor (var i = 0; i < coll.length; i++) {\n\t\tthis.add(coll[i]);\n\t}\n\treturn false;\n};\n\nATNConfigSet.prototype.equals = function(other) {\n\treturn this === other ||\n\t\t(other instanceof ATNConfigSet &&\n\t\tUtils.equalArrays(this.configs, other.configs) &&\n\t\tthis.fullCtx === other.fullCtx &&\n\t\tthis.uniqueAlt === other.uniqueAlt &&\n\t\tthis.conflictingAlts === other.conflictingAlts &&\n\t\tthis.hasSemanticContext === other.hasSemanticContext &&\n\t\tthis.dipsIntoOuterContext === other.dipsIntoOuterContext);\n};\n\nATNConfigSet.prototype.hashCode = function() {\n    var hash = new Hash();\n    this.updateHashCode(hash);\n    return hash.finish();\n};\n\n\nATNConfigSet.prototype.updateHashCode = function(hash) {\n\tif (this.readOnly) {\n\t\tif (this.cachedHashCode === -1) {\n            var hash = new Hash();\n            hash.update(this.configs);\n\t\t\tthis.cachedHashCode = hash.finish();\n\t\t}\n        hash.update(this.cachedHashCode);\n\t} else {\n        hash.update(this.configs);\n\t}\n};\n\n\nObject.defineProperty(ATNConfigSet.prototype, \"length\", {\n\tget : function() {\n\t\treturn this.configs.length;\n\t}\n});\n\nATNConfigSet.prototype.isEmpty = function() {\n\treturn this.configs.length === 0;\n};\n\nATNConfigSet.prototype.contains = function(item) {\n\tif (this.configLookup === null) {\n\t\tthrow \"This method is not implemented for readonly sets.\";\n\t}\n\treturn this.configLookup.contains(item);\n};\n\nATNConfigSet.prototype.containsFast = function(item) {\n\tif (this.configLookup === null) {\n\t\tthrow \"This method is not implemented for readonly sets.\";\n\t}\n\treturn this.configLookup.containsFast(item);\n};\n\nATNConfigSet.prototype.clear = function() {\n\tif (this.readOnly) {\n\t\tthrow \"This set is readonly\";\n\t}\n\tthis.configs = [];\n\tthis.cachedHashCode = -1;\n\tthis.configLookup = new Set();\n};\n\nATNConfigSet.prototype.setReadonly = function(readOnly) {\n\tthis.readOnly = readOnly;\n\tif (readOnly) {\n\t\tthis.configLookup = null; // can't mod, no need for lookup cache\n\t}\n};\n\nATNConfigSet.prototype.toString = function() {\n\treturn Utils.arrayToString(this.configs) +\n\t\t(this.hasSemanticContext ? \",hasSemanticContext=\" + this.hasSemanticContext : \"\") +\n\t\t(this.uniqueAlt !== ATN.INVALID_ALT_NUMBER ? \",uniqueAlt=\" + this.uniqueAlt : \"\") +\n\t\t(this.conflictingAlts !== null ? \",conflictingAlts=\" + this.conflictingAlts : \"\") +\n\t\t(this.dipsIntoOuterContext ? \",dipsIntoOuterContext\" : \"\");\n};\n\nfunction OrderedATNConfigSet() {\n\tATNConfigSet.call(this);\n\tthis.configLookup = new Set();\n\treturn this;\n}\n\nOrderedATNConfigSet.prototype = Object.create(ATNConfigSet.prototype);\nOrderedATNConfigSet.prototype.constructor = OrderedATNConfigSet;\n\nexports.ATNConfigSet = ATNConfigSet;\nexports.OrderedATNConfigSet = OrderedATNConfigSet;\n","/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n\nfunction ATNDeserializationOptions(copyFrom) {\n\tif(copyFrom===undefined) {\n\t\tcopyFrom = null;\n\t}\n\tthis.readOnly = false;\n    this.verifyATN = copyFrom===null ? true : copyFrom.verifyATN;\n    this.generateRuleBypassTransitions = copyFrom===null ? false : copyFrom.generateRuleBypassTransitions;\n\n    return this;\n}\n\nATNDeserializationOptions.defaultOptions = new ATNDeserializationOptions();\nATNDeserializationOptions.defaultOptions.readOnly = true;\n\n//    def __setattr__(self, key, value):\n//        if key!=\"readOnly\" and self.readOnly:\n//            raise Exception(\"The object is read only.\")\n//        super(type(self), self).__setattr__(key,value)\n\nexports.ATNDeserializationOptions = ATNDeserializationOptions;\n","/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n\nvar Token = require('./../Token').Token;\nvar ATN = require('./ATN').ATN;\nvar ATNType = require('./ATNType').ATNType;\nvar ATNStates = require('./ATNState');\nvar ATNState = ATNStates.ATNState;\nvar BasicState = ATNStates.BasicState;\nvar DecisionState = ATNStates.DecisionState;\nvar BlockStartState = ATNStates.BlockStartState;\nvar BlockEndState = ATNStates.BlockEndState;\nvar LoopEndState = ATNStates.LoopEndState;\nvar RuleStartState = ATNStates.RuleStartState;\nvar RuleStopState = ATNStates.RuleStopState;\nvar TokensStartState = ATNStates.TokensStartState;\nvar PlusLoopbackState = ATNStates.PlusLoopbackState;\nvar StarLoopbackState = ATNStates.StarLoopbackState;\nvar StarLoopEntryState = ATNStates.StarLoopEntryState;\nvar PlusBlockStartState = ATNStates.PlusBlockStartState;\nvar StarBlockStartState = ATNStates.StarBlockStartState;\nvar BasicBlockStartState = ATNStates.BasicBlockStartState;\nvar Transitions = require('./Transition');\nvar Transition = Transitions.Transition;\nvar AtomTransition = Transitions.AtomTransition;\nvar SetTransition = Transitions.SetTransition;\nvar NotSetTransition = Transitions.NotSetTransition;\nvar RuleTransition = Transitions.RuleTransition;\nvar RangeTransition = Transitions.RangeTransition;\nvar ActionTransition = Transitions.ActionTransition;\nvar EpsilonTransition = Transitions.EpsilonTransition;\nvar WildcardTransition = Transitions.WildcardTransition;\nvar PredicateTransition = Transitions.PredicateTransition;\nvar PrecedencePredicateTransition = Transitions.PrecedencePredicateTransition;\nvar IntervalSet = require('./../IntervalSet').IntervalSet;\nvar Interval = require('./../IntervalSet').Interval;\nvar ATNDeserializationOptions = require('./ATNDeserializationOptions').ATNDeserializationOptions;\nvar LexerActions = require('./LexerAction');\nvar LexerActionType = LexerActions.LexerActionType;\nvar LexerSkipAction = LexerActions.LexerSkipAction;\nvar LexerChannelAction = LexerActions.LexerChannelAction;\nvar LexerCustomAction = LexerActions.LexerCustomAction;\nvar LexerMoreAction = LexerActions.LexerMoreAction;\nvar LexerTypeAction = LexerActions.LexerTypeAction;\nvar LexerPushModeAction = LexerActions.LexerPushModeAction;\nvar LexerPopModeAction = LexerActions.LexerPopModeAction;\nvar LexerModeAction = LexerActions.LexerModeAction;\n// This is the earliest supported serialized UUID.\n// stick to serialized version for now, we don't need a UUID instance\nvar BASE_SERIALIZED_UUID = \"AADB8D7E-AEEF-4415-AD2B-8204D6CF042E\";\n\n//\n// This UUID indicates the serialized ATN contains two sets of\n// IntervalSets, where the second set's values are encoded as\n// 32-bit integers to support the full Unicode SMP range up to U+10FFFF.\n//\nvar ADDED_UNICODE_SMP = \"59627784-3BE5-417A-B9EB-8131A7286089\";\n\n// This list contains all of the currently supported UUIDs, ordered by when\n// the feature first appeared in this branch.\nvar SUPPORTED_UUIDS = [ BASE_SERIALIZED_UUID, ADDED_UNICODE_SMP ];\n\nvar SERIALIZED_VERSION = 3;\n\n// This is the current serialized UUID.\nvar SERIALIZED_UUID = ADDED_UNICODE_SMP;\n\nfunction initArray( length, value) {\n\tvar tmp = [];\n\ttmp[length-1] = value;\n\treturn tmp.map(function(i) {return value;});\n}\n\nfunction ATNDeserializer (options) {\n\n    if ( options=== undefined || options === null ) {\n        options = ATNDeserializationOptions.defaultOptions;\n    }\n    this.deserializationOptions = options;\n    this.stateFactories = null;\n    this.actionFactories = null;\n\n    return this;\n}\n\n// Determines if a particular serialized representation of an ATN supports\n// a particular feature, identified by the {@link UUID} used for serializing\n// the ATN at the time the feature was first introduced.\n//\n// @param feature The {@link UUID} marking the first time the feature was\n// supported in the serialized ATN.\n// @param actualUuid The {@link UUID} of the actual serialized ATN which is\n// currently being deserialized.\n// @return {@code true} if the {@code actualUuid} value represents a\n// serialized ATN at or after the feature identified by {@code feature} was\n// introduced; otherwise, {@code false}.\n\nATNDeserializer.prototype.isFeatureSupported = function(feature, actualUuid) {\n    var idx1 = SUPPORTED_UUIDS.indexOf(feature);\n    if (idx1<0) {\n        return false;\n    }\n    var idx2 = SUPPORTED_UUIDS.indexOf(actualUuid);\n    return idx2 >= idx1;\n};\n\nATNDeserializer.prototype.deserialize = function(data) {\n    this.reset(data);\n    this.checkVersion();\n    this.checkUUID();\n    var atn = this.readATN();\n    this.readStates(atn);\n    this.readRules(atn);\n    this.readModes(atn);\n    var sets = [];\n    // First, deserialize sets with 16-bit arguments <= U+FFFF.\n    this.readSets(atn, sets, this.readInt.bind(this));\n    // Next, if the ATN was serialized with the Unicode SMP feature,\n    // deserialize sets with 32-bit arguments <= U+10FFFF.\n    if (this.isFeatureSupported(ADDED_UNICODE_SMP, this.uuid)) {\n        this.readSets(atn, sets, this.readInt32.bind(this));\n    }\n    this.readEdges(atn, sets);\n    this.readDecisions(atn);\n    this.readLexerActions(atn);\n    this.markPrecedenceDecisions(atn);\n    this.verifyATN(atn);\n    if (this.deserializationOptions.generateRuleBypassTransitions && atn.grammarType === ATNType.PARSER ) {\n        this.generateRuleBypassTransitions(atn);\n        // re-verify after modification\n        this.verifyATN(atn);\n    }\n    return atn;\n};\n\nATNDeserializer.prototype.reset = function(data) {\n\tvar adjust = function(c) {\n        var v = c.charCodeAt(0);\n        return v>1  ? v-2 : v + 65533;\n\t};\n    var temp = data.split(\"\").map(adjust);\n    // don't adjust the first value since that's the version number\n    temp[0] = data.charCodeAt(0);\n    this.data = temp;\n    this.pos = 0;\n};\n\nATNDeserializer.prototype.checkVersion = function() {\n    var version = this.readInt();\n    if ( version !== SERIALIZED_VERSION ) {\n        throw (\"Could not deserialize ATN with version \" + version + \" (expected \" + SERIALIZED_VERSION + \").\");\n    }\n};\n\nATNDeserializer.prototype.checkUUID = function() {\n    var uuid = this.readUUID();\n    if (SUPPORTED_UUIDS.indexOf(uuid)<0) {\n        throw (\"Could not deserialize ATN with UUID: \" + uuid +\n                        \" (expected \" + SERIALIZED_UUID + \" or a legacy UUID).\", uuid, SERIALIZED_UUID);\n    }\n    this.uuid = uuid;\n};\n\nATNDeserializer.prototype.readATN = function() {\n    var grammarType = this.readInt();\n    var maxTokenType = this.readInt();\n    return new ATN(grammarType, maxTokenType);\n};\n\nATNDeserializer.prototype.readStates = function(atn) {\n\tvar j, pair, stateNumber;\n    var loopBackStateNumbers = [];\n    var endStateNumbers = [];\n    var nstates = this.readInt();\n    for(var i=0; i<nstates; i++) {\n        var stype = this.readInt();\n        // ignore bad type of states\n        if (stype===ATNState.INVALID_TYPE) {\n            atn.addState(null);\n            continue;\n        }\n        var ruleIndex = this.readInt();\n        if (ruleIndex === 0xFFFF) {\n            ruleIndex = -1;\n        }\n        var s = this.stateFactory(stype, ruleIndex);\n        if (stype === ATNState.LOOP_END) { // special case\n            var loopBackStateNumber = this.readInt();\n            loopBackStateNumbers.push([s, loopBackStateNumber]);\n        } else if(s instanceof BlockStartState) {\n            var endStateNumber = this.readInt();\n            endStateNumbers.push([s, endStateNumber]);\n        }\n        atn.addState(s);\n    }\n    // delay the assignment of loop back and end states until we know all the\n\t// state instances have been initialized\n    for (j=0; j<loopBackStateNumbers.length; j++) {\n        pair = loopBackStateNumbers[j];\n        pair[0].loopBackState = atn.states[pair[1]];\n    }\n\n    for (j=0; j<endStateNumbers.length; j++) {\n        pair = endStateNumbers[j];\n        pair[0].endState = atn.states[pair[1]];\n    }\n\n    var numNonGreedyStates = this.readInt();\n    for (j=0; j<numNonGreedyStates; j++) {\n        stateNumber = this.readInt();\n        atn.states[stateNumber].nonGreedy = true;\n    }\n\n    var numPrecedenceStates = this.readInt();\n    for (j=0; j<numPrecedenceStates; j++) {\n        stateNumber = this.readInt();\n        atn.states[stateNumber].isPrecedenceRule = true;\n    }\n};\n\nATNDeserializer.prototype.readRules = function(atn) {\n    var i;\n    var nrules = this.readInt();\n    if (atn.grammarType === ATNType.LEXER ) {\n        atn.ruleToTokenType = initArray(nrules, 0);\n    }\n    atn.ruleToStartState = initArray(nrules, 0);\n    for (i=0; i<nrules; i++) {\n        var s = this.readInt();\n        var startState = atn.states[s];\n        atn.ruleToStartState[i] = startState;\n        if ( atn.grammarType === ATNType.LEXER ) {\n            var tokenType = this.readInt();\n            if (tokenType === 0xFFFF) {\n                tokenType = Token.EOF;\n            }\n            atn.ruleToTokenType[i] = tokenType;\n        }\n    }\n    atn.ruleToStopState = initArray(nrules, 0);\n    for (i=0; i<atn.states.length; i++) {\n        var state = atn.states[i];\n        if (!(state instanceof RuleStopState)) {\n            continue;\n        }\n        atn.ruleToStopState[state.ruleIndex] = state;\n        atn.ruleToStartState[state.ruleIndex].stopState = state;\n    }\n};\n\nATNDeserializer.prototype.readModes = function(atn) {\n    var nmodes = this.readInt();\n    for (var i=0; i<nmodes; i++) {\n        var s = this.readInt();\n        atn.modeToStartState.push(atn.states[s]);\n    }\n};\n\nATNDeserializer.prototype.readSets = function(atn, sets, readUnicode) {\n    var m = this.readInt();\n    for (var i=0; i<m; i++) {\n        var iset = new IntervalSet();\n        sets.push(iset);\n        var n = this.readInt();\n        var containsEof = this.readInt();\n        if (containsEof!==0) {\n            iset.addOne(-1);\n        }\n        for (var j=0; j<n; j++) {\n            var i1 = readUnicode();\n            var i2 = readUnicode();\n            iset.addRange(i1, i2);\n        }\n    }\n};\n\nATNDeserializer.prototype.readEdges = function(atn, sets) {\n\tvar i, j, state, trans, target;\n    var nedges = this.readInt();\n    for (i=0; i<nedges; i++) {\n        var src = this.readInt();\n        var trg = this.readInt();\n        var ttype = this.readInt();\n        var arg1 = this.readInt();\n        var arg2 = this.readInt();\n        var arg3 = this.readInt();\n        trans = this.edgeFactory(atn, ttype, src, trg, arg1, arg2, arg3, sets);\n        var srcState = atn.states[src];\n        srcState.addTransition(trans);\n    }\n    // edges for rule stop states can be derived, so they aren't serialized\n    for (i=0; i<atn.states.length; i++) {\n        state = atn.states[i];\n        for (j=0; j<state.transitions.length; j++) {\n            var t = state.transitions[j];\n            if (!(t instanceof RuleTransition)) {\n                continue;\n            }\n\t\t\tvar outermostPrecedenceReturn = -1;\n\t\t\tif (atn.ruleToStartState[t.target.ruleIndex].isPrecedenceRule) {\n\t\t\t\tif (t.precedence === 0) {\n\t\t\t\t\toutermostPrecedenceReturn = t.target.ruleIndex;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\ttrans = new EpsilonTransition(t.followState, outermostPrecedenceReturn);\n            atn.ruleToStopState[t.target.ruleIndex].addTransition(trans);\n        }\n    }\n\n    for (i=0; i<atn.states.length; i++) {\n        state = atn.states[i];\n        if (state instanceof BlockStartState) {\n            // we need to know the end state to set its start state\n            if (state.endState === null) {\n                throw (\"IllegalState\");\n            }\n            // block end states can only be associated to a single block start\n\t\t\t// state\n            if ( state.endState.startState !== null) {\n                throw (\"IllegalState\");\n            }\n            state.endState.startState = state;\n        }\n        if (state instanceof PlusLoopbackState) {\n            for (j=0; j<state.transitions.length; j++) {\n                target = state.transitions[j].target;\n                if (target instanceof PlusBlockStartState) {\n                    target.loopBackState = state;\n                }\n            }\n        } else if (state instanceof StarLoopbackState) {\n            for (j=0; j<state.transitions.length; j++) {\n                target = state.transitions[j].target;\n                if (target instanceof StarLoopEntryState) {\n                    target.loopBackState = state;\n                }\n            }\n        }\n    }\n};\n\nATNDeserializer.prototype.readDecisions = function(atn) {\n    var ndecisions = this.readInt();\n    for (var i=0; i<ndecisions; i++) {\n        var s = this.readInt();\n        var decState = atn.states[s];\n        atn.decisionToState.push(decState);\n        decState.decision = i;\n    }\n};\n\nATNDeserializer.prototype.readLexerActions = function(atn) {\n    if (atn.grammarType === ATNType.LEXER) {\n        var count = this.readInt();\n        atn.lexerActions = initArray(count, null);\n        for (var i=0; i<count; i++) {\n            var actionType = this.readInt();\n            var data1 = this.readInt();\n            if (data1 === 0xFFFF) {\n                data1 = -1;\n            }\n            var data2 = this.readInt();\n            if (data2 === 0xFFFF) {\n                data2 = -1;\n            }\n            var lexerAction = this.lexerActionFactory(actionType, data1, data2);\n            atn.lexerActions[i] = lexerAction;\n        }\n    }\n};\n\nATNDeserializer.prototype.generateRuleBypassTransitions = function(atn) {\n\tvar i;\n    var count = atn.ruleToStartState.length;\n    for(i=0; i<count; i++) {\n        atn.ruleToTokenType[i] = atn.maxTokenType + i + 1;\n    }\n    for(i=0; i<count; i++) {\n        this.generateRuleBypassTransition(atn, i);\n    }\n};\n\nATNDeserializer.prototype.generateRuleBypassTransition = function(atn, idx) {\n\tvar i, state;\n    var bypassStart = new BasicBlockStartState();\n    bypassStart.ruleIndex = idx;\n    atn.addState(bypassStart);\n\n    var bypassStop = new BlockEndState();\n    bypassStop.ruleIndex = idx;\n    atn.addState(bypassStop);\n\n    bypassStart.endState = bypassStop;\n    atn.defineDecisionState(bypassStart);\n\n    bypassStop.startState = bypassStart;\n\n    var excludeTransition = null;\n    var endState = null;\n\n    if (atn.ruleToStartState[idx].isPrecedenceRule) {\n        // wrap from the beginning of the rule to the StarLoopEntryState\n        endState = null;\n        for(i=0; i<atn.states.length; i++) {\n            state = atn.states[i];\n            if (this.stateIsEndStateFor(state, idx)) {\n                endState = state;\n                excludeTransition = state.loopBackState.transitions[0];\n                break;\n            }\n        }\n        if (excludeTransition === null) {\n            throw (\"Couldn't identify final state of the precedence rule prefix section.\");\n        }\n    } else {\n        endState = atn.ruleToStopState[idx];\n    }\n\n    // all non-excluded transitions that currently target end state need to\n\t// target blockEnd instead\n    for(i=0; i<atn.states.length; i++) {\n        state = atn.states[i];\n        for(var j=0; j<state.transitions.length; j++) {\n            var transition = state.transitions[j];\n            if (transition === excludeTransition) {\n                continue;\n            }\n            if (transition.target === endState) {\n                transition.target = bypassStop;\n            }\n        }\n    }\n\n    // all transitions leaving the rule start state need to leave blockStart\n\t// instead\n    var ruleToStartState = atn.ruleToStartState[idx];\n    var count = ruleToStartState.transitions.length;\n    while ( count > 0) {\n        bypassStart.addTransition(ruleToStartState.transitions[count-1]);\n        ruleToStartState.transitions = ruleToStartState.transitions.slice(-1);\n    }\n    // link the new states\n    atn.ruleToStartState[idx].addTransition(new EpsilonTransition(bypassStart));\n    bypassStop.addTransition(new EpsilonTransition(endState));\n\n    var matchState = new BasicState();\n    atn.addState(matchState);\n    matchState.addTransition(new AtomTransition(bypassStop, atn.ruleToTokenType[idx]));\n    bypassStart.addTransition(new EpsilonTransition(matchState));\n};\n\nATNDeserializer.prototype.stateIsEndStateFor = function(state, idx) {\n    if ( state.ruleIndex !== idx) {\n        return null;\n    }\n    if (!( state instanceof StarLoopEntryState)) {\n        return null;\n    }\n    var maybeLoopEndState = state.transitions[state.transitions.length - 1].target;\n    if (!( maybeLoopEndState instanceof LoopEndState)) {\n        return null;\n    }\n    if (maybeLoopEndState.epsilonOnlyTransitions &&\n        (maybeLoopEndState.transitions[0].target instanceof RuleStopState)) {\n        return state;\n    } else {\n        return null;\n    }\n};\n\n//\n// Analyze the {@link StarLoopEntryState} states in the specified ATN to set\n// the {@link StarLoopEntryState//isPrecedenceDecision} field to the\n// correct value.\n//\n// @param atn The ATN.\n//\nATNDeserializer.prototype.markPrecedenceDecisions = function(atn) {\n\tfor(var i=0; i<atn.states.length; i++) {\n\t\tvar state = atn.states[i];\n\t\tif (!( state instanceof StarLoopEntryState)) {\n            continue;\n        }\n        // We analyze the ATN to determine if this ATN decision state is the\n        // decision for the closure block that determines whether a\n        // precedence rule should continue or complete.\n        //\n        if ( atn.ruleToStartState[state.ruleIndex].isPrecedenceRule) {\n            var maybeLoopEndState = state.transitions[state.transitions.length - 1].target;\n            if (maybeLoopEndState instanceof LoopEndState) {\n                if ( maybeLoopEndState.epsilonOnlyTransitions &&\n                        (maybeLoopEndState.transitions[0].target instanceof RuleStopState)) {\n                    state.isPrecedenceDecision = true;\n                }\n            }\n        }\n\t}\n};\n\nATNDeserializer.prototype.verifyATN = function(atn) {\n    if (!this.deserializationOptions.verifyATN) {\n        return;\n    }\n    // verify assumptions\n\tfor(var i=0; i<atn.states.length; i++) {\n        var state = atn.states[i];\n        if (state === null) {\n            continue;\n        }\n        this.checkCondition(state.epsilonOnlyTransitions || state.transitions.length <= 1);\n        if (state instanceof PlusBlockStartState) {\n            this.checkCondition(state.loopBackState !== null);\n        } else  if (state instanceof StarLoopEntryState) {\n            this.checkCondition(state.loopBackState !== null);\n            this.checkCondition(state.transitions.length === 2);\n            if (state.transitions[0].target instanceof StarBlockStartState) {\n                this.checkCondition(state.transitions[1].target instanceof LoopEndState);\n                this.checkCondition(!state.nonGreedy);\n            } else if (state.transitions[0].target instanceof LoopEndState) {\n                this.checkCondition(state.transitions[1].target instanceof StarBlockStartState);\n                this.checkCondition(state.nonGreedy);\n            } else {\n                throw(\"IllegalState\");\n            }\n        } else if (state instanceof StarLoopbackState) {\n            this.checkCondition(state.transitions.length === 1);\n            this.checkCondition(state.transitions[0].target instanceof StarLoopEntryState);\n        } else if (state instanceof LoopEndState) {\n            this.checkCondition(state.loopBackState !== null);\n        } else if (state instanceof RuleStartState) {\n            this.checkCondition(state.stopState !== null);\n        } else if (state instanceof BlockStartState) {\n            this.checkCondition(state.endState !== null);\n        } else if (state instanceof BlockEndState) {\n            this.checkCondition(state.startState !== null);\n        } else if (state instanceof DecisionState) {\n            this.checkCondition(state.transitions.length <= 1 || state.decision >= 0);\n        } else {\n            this.checkCondition(state.transitions.length <= 1 || (state instanceof RuleStopState));\n        }\n\t}\n};\n\nATNDeserializer.prototype.checkCondition = function(condition, message) {\n    if (!condition) {\n        if (message === undefined || message===null) {\n            message = \"IllegalState\";\n        }\n        throw (message);\n    }\n};\n\nATNDeserializer.prototype.readInt = function() {\n    return this.data[this.pos++];\n};\n\nATNDeserializer.prototype.readInt32 = function() {\n    var low = this.readInt();\n    var high = this.readInt();\n    return low | (high << 16);\n};\n\nATNDeserializer.prototype.readLong = function() {\n    var low = this.readInt32();\n    var high = this.readInt32();\n    return (low & 0x00000000FFFFFFFF) | (high << 32);\n};\n\nfunction createByteToHex() {\n\tvar bth = [];\n\tfor (var i = 0; i < 256; i++) {\n\t\tbth[i] = (i + 0x100).toString(16).substr(1).toUpperCase();\n\t}\n\treturn bth;\n}\n\nvar byteToHex = createByteToHex();\n\nATNDeserializer.prototype.readUUID = function() {\n\tvar bb = [];\n\tfor(var i=7;i>=0;i--) {\n\t\tvar int = this.readInt();\n\t\t/* jshint bitwise: false */\n\t\tbb[(2*i)+1] = int & 0xFF;\n\t\tbb[2*i] = (int >> 8) & 0xFF;\n\t}\n    return byteToHex[bb[0]] + byteToHex[bb[1]] +\n    byteToHex[bb[2]] + byteToHex[bb[3]] + '-' +\n    byteToHex[bb[4]] + byteToHex[bb[5]] + '-' +\n    byteToHex[bb[6]] + byteToHex[bb[7]] + '-' +\n    byteToHex[bb[8]] + byteToHex[bb[9]] + '-' +\n    byteToHex[bb[10]] + byteToHex[bb[11]] +\n    byteToHex[bb[12]] + byteToHex[bb[13]] +\n    byteToHex[bb[14]] + byteToHex[bb[15]];\n};\n\nATNDeserializer.prototype.edgeFactory = function(atn, type, src, trg, arg1, arg2, arg3, sets) {\n    var target = atn.states[trg];\n    switch(type) {\n    case Transition.EPSILON:\n        return new EpsilonTransition(target);\n    case Transition.RANGE:\n        return arg3 !== 0 ? new RangeTransition(target, Token.EOF, arg2) : new RangeTransition(target, arg1, arg2);\n    case Transition.RULE:\n        return new RuleTransition(atn.states[arg1], arg2, arg3, target);\n    case Transition.PREDICATE:\n        return new PredicateTransition(target, arg1, arg2, arg3 !== 0);\n    case Transition.PRECEDENCE:\n        return new PrecedencePredicateTransition(target, arg1);\n    case Transition.ATOM:\n        return arg3 !== 0 ? new AtomTransition(target, Token.EOF) : new AtomTransition(target, arg1);\n    case Transition.ACTION:\n        return new ActionTransition(target, arg1, arg2, arg3 !== 0);\n    case Transition.SET:\n        return new SetTransition(target, sets[arg1]);\n    case Transition.NOT_SET:\n        return new NotSetTransition(target, sets[arg1]);\n    case Transition.WILDCARD:\n        return new WildcardTransition(target);\n    default:\n        throw \"The specified transition type: \" + type + \" is not valid.\";\n    }\n};\n\nATNDeserializer.prototype.stateFactory = function(type, ruleIndex) {\n    if (this.stateFactories === null) {\n        var sf = [];\n        sf[ATNState.INVALID_TYPE] = null;\n        sf[ATNState.BASIC] = function() { return new BasicState(); };\n        sf[ATNState.RULE_START] = function() { return new RuleStartState(); };\n        sf[ATNState.BLOCK_START] = function() { return new BasicBlockStartState(); };\n        sf[ATNState.PLUS_BLOCK_START] = function() { return new PlusBlockStartState(); };\n        sf[ATNState.STAR_BLOCK_START] = function() { return new StarBlockStartState(); };\n        sf[ATNState.TOKEN_START] = function() { return new TokensStartState(); };\n        sf[ATNState.RULE_STOP] = function() { return new RuleStopState(); };\n        sf[ATNState.BLOCK_END] = function() { return new BlockEndState(); };\n        sf[ATNState.STAR_LOOP_BACK] = function() { return new StarLoopbackState(); };\n        sf[ATNState.STAR_LOOP_ENTRY] = function() { return new StarLoopEntryState(); };\n        sf[ATNState.PLUS_LOOP_BACK] = function() { return new PlusLoopbackState(); };\n        sf[ATNState.LOOP_END] = function() { return new LoopEndState(); };\n        this.stateFactories = sf;\n    }\n    if (type>this.stateFactories.length || this.stateFactories[type] === null) {\n        throw(\"The specified state type \" + type + \" is not valid.\");\n    } else {\n        var s = this.stateFactories[type]();\n        if (s!==null) {\n            s.ruleIndex = ruleIndex;\n            return s;\n        }\n    }\n};\n\nATNDeserializer.prototype.lexerActionFactory = function(type, data1, data2) {\n    if (this.actionFactories === null) {\n        var af = [];\n        af[LexerActionType.CHANNEL] = function(data1, data2) { return new LexerChannelAction(data1); };\n        af[LexerActionType.CUSTOM] = function(data1, data2) { return new LexerCustomAction(data1, data2); };\n        af[LexerActionType.MODE] = function(data1, data2) { return new LexerModeAction(data1); };\n        af[LexerActionType.MORE] = function(data1, data2) { return LexerMoreAction.INSTANCE; };\n        af[LexerActionType.POP_MODE] = function(data1, data2) { return LexerPopModeAction.INSTANCE; };\n        af[LexerActionType.PUSH_MODE] = function(data1, data2) { return new LexerPushModeAction(data1); };\n        af[LexerActionType.SKIP] = function(data1, data2) { return LexerSkipAction.INSTANCE; };\n        af[LexerActionType.TYPE] = function(data1, data2) { return new LexerTypeAction(data1); };\n        this.actionFactories = af;\n    }\n    if (type>this.actionFactories.length || this.actionFactories[type] === null) {\n        throw(\"The specified lexer action type \" + type + \" is not valid.\");\n    } else {\n        return this.actionFactories[type](data1, data2);\n    }\n};\n\n\nexports.ATNDeserializer = ATNDeserializer;","//\n/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n///\n\nvar DFAState = require('./../dfa/DFAState').DFAState;\nvar ATNConfigSet = require('./ATNConfigSet').ATNConfigSet;\nvar getCachedPredictionContext = require('./../PredictionContext').getCachedPredictionContext;\n\nfunction ATNSimulator(atn, sharedContextCache) {\n\n    // The context cache maps all PredictionContext objects that are ==\n    //  to a single cached copy. This cache is shared across all contexts\n    //  in all ATNConfigs in all DFA states.  We rebuild each ATNConfigSet\n    //  to use only cached nodes/graphs in addDFAState(). We don't want to\n    //  fill this during closure() since there are lots of contexts that\n    //  pop up but are not used ever again. It also greatly slows down closure().\n    //\n    //  <p>This cache makes a huge difference in memory and a little bit in speed.\n    //  For the Java grammar on java.*, it dropped the memory requirements\n    //  at the end from 25M to 16M. We don't store any of the full context\n    //  graphs in the DFA because they are limited to local context only,\n    //  but apparently there's a lot of repetition there as well. We optimize\n    //  the config contexts before storing the config set in the DFA states\n    //  by literally rebuilding them with cached subgraphs only.</p>\n    //\n    //  <p>I tried a cache for use during closure operations, that was\n    //  whacked after each adaptivePredict(). It cost a little bit\n    //  more time I think and doesn't save on the overall footprint\n    //  so it's not worth the complexity.</p>\n    ///\n    this.atn = atn;\n    this.sharedContextCache = sharedContextCache;\n    return this;\n}\n\n// Must distinguish between missing edge and edge we know leads nowhere///\nATNSimulator.ERROR = new DFAState(0x7FFFFFFF, new ATNConfigSet());\n\n\nATNSimulator.prototype.getCachedContext = function(context) {\n    if (this.sharedContextCache ===null) {\n        return context;\n    }\n    var visited = {};\n    return getCachedPredictionContext(context, this.sharedContextCache, visited);\n};\n\nexports.ATNSimulator = ATNSimulator;\n","//\n/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n//\n\n// The following images show the relation of states and\n// {@link ATNState//transitions} for various grammar constructs.\n//\n// <ul>\n//\n// <li>Solid edges marked with an &//0949; indicate a required\n// {@link EpsilonTransition}.</li>\n//\n// <li>Dashed edges indicate locations where any transition derived from\n// {@link Transition} might appear.</li>\n//\n// <li>Dashed nodes are place holders for either a sequence of linked\n// {@link BasicState} states or the inclusion of a block representing a nested\n// construct in one of the forms below.</li>\n//\n// <li>Nodes showing multiple outgoing alternatives with a {@code ...} support\n// any number of alternatives (one or more). Nodes without the {@code ...} only\n// support the exact number of alternatives shown in the diagram.</li>\n//\n// </ul>\n//\n// <h2>Basic Blocks</h2>\n//\n// <h3>Rule</h3>\n//\n// <embed src=\"images/Rule.svg\" type=\"image/svg+xml\"/>\n//\n// <h3>Block of 1 or more alternatives</h3>\n//\n// <embed src=\"images/Block.svg\" type=\"image/svg+xml\"/>\n//\n// <h2>Greedy Loops</h2>\n//\n// <h3>Greedy Closure: {@code (...)*}</h3>\n//\n// <embed src=\"images/ClosureGreedy.svg\" type=\"image/svg+xml\"/>\n//\n// <h3>Greedy Positive Closure: {@code (...)+}</h3>\n//\n// <embed src=\"images/PositiveClosureGreedy.svg\" type=\"image/svg+xml\"/>\n//\n// <h3>Greedy Optional: {@code (...)?}</h3>\n//\n// <embed src=\"images/OptionalGreedy.svg\" type=\"image/svg+xml\"/>\n//\n// <h2>Non-Greedy Loops</h2>\n//\n// <h3>Non-Greedy Closure: {@code (...)*?}</h3>\n//\n// <embed src=\"images/ClosureNonGreedy.svg\" type=\"image/svg+xml\"/>\n//\n// <h3>Non-Greedy Positive Closure: {@code (...)+?}</h3>\n//\n// <embed src=\"images/PositiveClosureNonGreedy.svg\" type=\"image/svg+xml\"/>\n//\n// <h3>Non-Greedy Optional: {@code (...)??}</h3>\n//\n// <embed src=\"images/OptionalNonGreedy.svg\" type=\"image/svg+xml\"/>\n//\n\nvar INITIAL_NUM_TRANSITIONS = 4;\n\nfunction ATNState() {\n    // Which ATN are we in?\n    this.atn = null;\n    this.stateNumber = ATNState.INVALID_STATE_NUMBER;\n    this.stateType = null;\n    this.ruleIndex = 0; // at runtime, we don't have Rule objects\n    this.epsilonOnlyTransitions = false;\n    // Track the transitions emanating from this ATN state.\n    this.transitions = [];\n    // Used to cache lookahead during parsing, not used during construction\n    this.nextTokenWithinRule = null;\n    return this;\n}\n\n// constants for serialization\nATNState.INVALID_TYPE = 0;\nATNState.BASIC = 1;\nATNState.RULE_START = 2;\nATNState.BLOCK_START = 3;\nATNState.PLUS_BLOCK_START = 4;\nATNState.STAR_BLOCK_START = 5;\nATNState.TOKEN_START = 6;\nATNState.RULE_STOP = 7;\nATNState.BLOCK_END = 8;\nATNState.STAR_LOOP_BACK = 9;\nATNState.STAR_LOOP_ENTRY = 10;\nATNState.PLUS_LOOP_BACK = 11;\nATNState.LOOP_END = 12;\n\nATNState.serializationNames = [\n            \"INVALID\",\n            \"BASIC\",\n            \"RULE_START\",\n            \"BLOCK_START\",\n            \"PLUS_BLOCK_START\",\n            \"STAR_BLOCK_START\",\n            \"TOKEN_START\",\n            \"RULE_STOP\",\n            \"BLOCK_END\",\n            \"STAR_LOOP_BACK\",\n            \"STAR_LOOP_ENTRY\",\n            \"PLUS_LOOP_BACK\",\n            \"LOOP_END\" ];\n\nATNState.INVALID_STATE_NUMBER = -1;\n\nATNState.prototype.toString = function() {\n\treturn this.stateNumber;\n};\n\nATNState.prototype.equals = function(other) {\n    if (other instanceof ATNState) {\n        return this.stateNumber===other.stateNumber;\n    } else {\n        return false;\n    }\n};\n\nATNState.prototype.isNonGreedyExitState = function() {\n    return false;\n};\n\n\nATNState.prototype.addTransition = function(trans, index) {\n\tif(index===undefined) {\n\t\tindex = -1;\n\t}\n    if (this.transitions.length===0) {\n        this.epsilonOnlyTransitions = trans.isEpsilon;\n    } else if(this.epsilonOnlyTransitions !== trans.isEpsilon) {\n        this.epsilonOnlyTransitions = false;\n    }\n    if (index===-1) {\n        this.transitions.push(trans);\n    } else {\n        this.transitions.splice(index, 1, trans);\n    }\n};\n\nfunction BasicState() {\n\tATNState.call(this);\n    this.stateType = ATNState.BASIC;\n    return this;\n}\n\nBasicState.prototype = Object.create(ATNState.prototype);\nBasicState.prototype.constructor = BasicState;\n\n\nfunction DecisionState() {\n\tATNState.call(this);\n    this.decision = -1;\n    this.nonGreedy = false;\n    return this;\n}\n\nDecisionState.prototype = Object.create(ATNState.prototype);\nDecisionState.prototype.constructor = DecisionState;\n\n\n//  The start of a regular {@code (...)} block.\nfunction BlockStartState() {\n\tDecisionState.call(this);\n\tthis.endState = null;\n\treturn this;\n}\n\nBlockStartState.prototype = Object.create(DecisionState.prototype);\nBlockStartState.prototype.constructor = BlockStartState;\n\n\nfunction BasicBlockStartState() {\n\tBlockStartState.call(this);\n\tthis.stateType = ATNState.BLOCK_START;\n\treturn this;\n}\n\nBasicBlockStartState.prototype = Object.create(BlockStartState.prototype);\nBasicBlockStartState.prototype.constructor = BasicBlockStartState;\n\n\n// Terminal node of a simple {@code (a|b|c)} block.\nfunction BlockEndState() {\n\tATNState.call(this);\n\tthis.stateType = ATNState.BLOCK_END;\n    this.startState = null;\n    return this;\n}\n\nBlockEndState.prototype = Object.create(ATNState.prototype);\nBlockEndState.prototype.constructor = BlockEndState;\n\n\n// The last node in the ATN for a rule, unless that rule is the start symbol.\n//  In that case, there is one transition to EOF. Later, we might encode\n//  references to all calls to this rule to compute FOLLOW sets for\n//  error handling.\n//\nfunction RuleStopState() {\n\tATNState.call(this);\n    this.stateType = ATNState.RULE_STOP;\n    return this;\n}\n\nRuleStopState.prototype = Object.create(ATNState.prototype);\nRuleStopState.prototype.constructor = RuleStopState;\n\nfunction RuleStartState() {\n\tATNState.call(this);\n\tthis.stateType = ATNState.RULE_START;\n\tthis.stopState = null;\n\tthis.isPrecedenceRule = false;\n\treturn this;\n}\n\nRuleStartState.prototype = Object.create(ATNState.prototype);\nRuleStartState.prototype.constructor = RuleStartState;\n\n// Decision state for {@code A+} and {@code (A|B)+}.  It has two transitions:\n//  one to the loop back to start of the block and one to exit.\n//\nfunction PlusLoopbackState() {\n\tDecisionState.call(this);\n\tthis.stateType = ATNState.PLUS_LOOP_BACK;\n\treturn this;\n}\n\nPlusLoopbackState.prototype = Object.create(DecisionState.prototype);\nPlusLoopbackState.prototype.constructor = PlusLoopbackState;\n\n\n// Start of {@code (A|B|...)+} loop. Technically a decision state, but\n//  we don't use for code generation; somebody might need it, so I'm defining\n//  it for completeness. In reality, the {@link PlusLoopbackState} node is the\n//  real decision-making note for {@code A+}.\n//\nfunction PlusBlockStartState() {\n\tBlockStartState.call(this);\n\tthis.stateType = ATNState.PLUS_BLOCK_START;\n    this.loopBackState = null;\n    return this;\n}\n\nPlusBlockStartState.prototype = Object.create(BlockStartState.prototype);\nPlusBlockStartState.prototype.constructor = PlusBlockStartState;\n\n// The block that begins a closure loop.\nfunction StarBlockStartState() {\n\tBlockStartState.call(this);\n\tthis.stateType = ATNState.STAR_BLOCK_START;\n\treturn this;\n}\n\nStarBlockStartState.prototype = Object.create(BlockStartState.prototype);\nStarBlockStartState.prototype.constructor = StarBlockStartState;\n\n\nfunction StarLoopbackState() {\n\tATNState.call(this);\n\tthis.stateType = ATNState.STAR_LOOP_BACK;\n\treturn this;\n}\n\nStarLoopbackState.prototype = Object.create(ATNState.prototype);\nStarLoopbackState.prototype.constructor = StarLoopbackState;\n\n\nfunction StarLoopEntryState() {\n\tDecisionState.call(this);\n\tthis.stateType = ATNState.STAR_LOOP_ENTRY;\n    this.loopBackState = null;\n    // Indicates whether this state can benefit from a precedence DFA during SLL decision making.\n    this.isPrecedenceDecision = null;\n    return this;\n}\n\nStarLoopEntryState.prototype = Object.create(DecisionState.prototype);\nStarLoopEntryState.prototype.constructor = StarLoopEntryState;\n\n\n// Mark the end of a * or + loop.\nfunction LoopEndState() {\n\tATNState.call(this);\n\tthis.stateType = ATNState.LOOP_END;\n\tthis.loopBackState = null;\n\treturn this;\n}\n\nLoopEndState.prototype = Object.create(ATNState.prototype);\nLoopEndState.prototype.constructor = LoopEndState;\n\n\n// The Tokens rule start state linking to each lexer rule start state */\nfunction TokensStartState() {\n\tDecisionState.call(this);\n\tthis.stateType = ATNState.TOKEN_START;\n\treturn this;\n}\n\nTokensStartState.prototype = Object.create(DecisionState.prototype);\nTokensStartState.prototype.constructor = TokensStartState;\n\nexports.ATNState = ATNState;\nexports.BasicState = BasicState;\nexports.DecisionState = DecisionState;\nexports.BlockStartState = BlockStartState;\nexports.BlockEndState = BlockEndState;\nexports.LoopEndState = LoopEndState;\nexports.RuleStartState = RuleStartState;\nexports.RuleStopState = RuleStopState;\nexports.TokensStartState = TokensStartState;\nexports.PlusLoopbackState = PlusLoopbackState;\nexports.StarLoopbackState = StarLoopbackState;\nexports.StarLoopEntryState = StarLoopEntryState;\nexports.PlusBlockStartState = PlusBlockStartState;\nexports.StarBlockStartState = StarBlockStartState;\nexports.BasicBlockStartState = BasicBlockStartState;\n","/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n///\n\n// Represents the type of recognizer an ATN applies to.\n\nfunction ATNType() {\n\n}\n\nATNType.LEXER = 0;\nATNType.PARSER = 1;\n\nexports.ATNType = ATNType;\n\n","//\n/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n///\n\n// When we hit an accept state in either the DFA or the ATN, we\n//  have to notify the character stream to start buffering characters\n//  via {@link IntStream//mark} and record the current state. The current sim state\n//  includes the current index into the input, the current line,\n//  and current character position in that line. Note that the Lexer is\n//  tracking the starting line and characterization of the token. These\n//  variables track the \"state\" of the simulator when it hits an accept state.\n//\n//  <p>We track these variables separately for the DFA and ATN simulation\n//  because the DFA simulation often has to fail over to the ATN\n//  simulation. If the ATN simulation fails, we need the DFA to fall\n//  back to its previously accepted state, if any. If the ATN succeeds,\n//  then the ATN does the accept and the DFA simulator that invoked it\n//  can simply return the predicted token type.</p>\n///\n\nvar Token = require('./../Token').Token;\nvar Lexer = require('./../Lexer').Lexer;\nvar ATN = require('./ATN').ATN;\nvar ATNSimulator = require('./ATNSimulator').ATNSimulator;\nvar DFAState = require('./../dfa/DFAState').DFAState;\nvar ATNConfigSet = require('./ATNConfigSet').ATNConfigSet;\nvar OrderedATNConfigSet = require('./ATNConfigSet').OrderedATNConfigSet;\nvar PredictionContext = require('./../PredictionContext').PredictionContext;\nvar SingletonPredictionContext = require('./../PredictionContext').SingletonPredictionContext;\nvar RuleStopState = require('./ATNState').RuleStopState;\nvar LexerATNConfig = require('./ATNConfig').LexerATNConfig;\nvar Transition = require('./Transition').Transition;\nvar LexerActionExecutor = require('./LexerActionExecutor').LexerActionExecutor;\nvar LexerNoViableAltException = require('./../error/Errors').LexerNoViableAltException;\n\nfunction resetSimState(sim) {\n\tsim.index = -1;\n\tsim.line = 0;\n\tsim.column = -1;\n\tsim.dfaState = null;\n}\n\nfunction SimState() {\n\tresetSimState(this);\n\treturn this;\n}\n\nSimState.prototype.reset = function() {\n\tresetSimState(this);\n};\n\nfunction LexerATNSimulator(recog, atn, decisionToDFA, sharedContextCache) {\n\tATNSimulator.call(this, atn, sharedContextCache);\n\tthis.decisionToDFA = decisionToDFA;\n\tthis.recog = recog;\n\t// The current token's starting index into the character stream.\n\t// Shared across DFA to ATN simulation in case the ATN fails and the\n\t// DFA did not have a previous accept state. In this case, we use the\n\t// ATN-generated exception object.\n\tthis.startIndex = -1;\n\t// line number 1..n within the input///\n\tthis.line = 1;\n\t// The index of the character relative to the beginning of the line\n\t// 0..n-1///\n\tthis.column = 0;\n\tthis.mode = Lexer.DEFAULT_MODE;\n\t// Used during DFA/ATN exec to record the most recent accept configuration\n\t// info\n\tthis.prevAccept = new SimState();\n\t// done\n\treturn this;\n}\n\nLexerATNSimulator.prototype = Object.create(ATNSimulator.prototype);\nLexerATNSimulator.prototype.constructor = LexerATNSimulator;\n\nLexerATNSimulator.debug = false;\nLexerATNSimulator.dfa_debug = false;\n\nLexerATNSimulator.MIN_DFA_EDGE = 0;\nLexerATNSimulator.MAX_DFA_EDGE = 127; // forces unicode to stay in ATN\n\nLexerATNSimulator.match_calls = 0;\n\nLexerATNSimulator.prototype.copyState = function(simulator) {\n\tthis.column = simulator.column;\n\tthis.line = simulator.line;\n\tthis.mode = simulator.mode;\n\tthis.startIndex = simulator.startIndex;\n};\n\nLexerATNSimulator.prototype.match = function(input, mode) {\n\tthis.match_calls += 1;\n\tthis.mode = mode;\n\tvar mark = input.mark();\n\ttry {\n\t\tthis.startIndex = input.index;\n\t\tthis.prevAccept.reset();\n\t\tvar dfa = this.decisionToDFA[mode];\n\t\tif (dfa.s0 === null) {\n\t\t\treturn this.matchATN(input);\n\t\t} else {\n\t\t\treturn this.execATN(input, dfa.s0);\n\t\t}\n\t} finally {\n\t\tinput.release(mark);\n\t}\n};\n\nLexerATNSimulator.prototype.reset = function() {\n\tthis.prevAccept.reset();\n\tthis.startIndex = -1;\n\tthis.line = 1;\n\tthis.column = 0;\n\tthis.mode = Lexer.DEFAULT_MODE;\n};\n\nLexerATNSimulator.prototype.matchATN = function(input) {\n\tvar startState = this.atn.modeToStartState[this.mode];\n\n\tif (LexerATNSimulator.debug) {\n\t\tconsole.log(\"matchATN mode \" + this.mode + \" start: \" + startState);\n\t}\n\tvar old_mode = this.mode;\n\tvar s0_closure = this.computeStartState(input, startState);\n\tvar suppressEdge = s0_closure.hasSemanticContext;\n\ts0_closure.hasSemanticContext = false;\n\n\tvar next = this.addDFAState(s0_closure);\n\tif (!suppressEdge) {\n\t\tthis.decisionToDFA[this.mode].s0 = next;\n\t}\n\n\tvar predict = this.execATN(input, next);\n\n\tif (LexerATNSimulator.debug) {\n\t\tconsole.log(\"DFA after matchATN: \" + this.decisionToDFA[old_mode].toLexerString());\n\t}\n\treturn predict;\n};\n\nLexerATNSimulator.prototype.execATN = function(input, ds0) {\n\tif (LexerATNSimulator.debug) {\n\t\tconsole.log(\"start state closure=\" + ds0.configs);\n\t}\n\tif (ds0.isAcceptState) {\n\t\t// allow zero-length tokens\n\t\tthis.captureSimState(this.prevAccept, input, ds0);\n\t}\n\tvar t = input.LA(1);\n\tvar s = ds0; // s is current/from DFA state\n\n\twhile (true) { // while more work\n\t\tif (LexerATNSimulator.debug) {\n\t\t\tconsole.log(\"execATN loop starting closure: \" + s.configs);\n\t\t}\n\n\t\t// As we move src->trg, src->trg, we keep track of the previous trg to\n\t\t// avoid looking up the DFA state again, which is expensive.\n\t\t// If the previous target was already part of the DFA, we might\n\t\t// be able to avoid doing a reach operation upon t. If s!=null,\n\t\t// it means that semantic predicates didn't prevent us from\n\t\t// creating a DFA state. Once we know s!=null, we check to see if\n\t\t// the DFA state has an edge already for t. If so, we can just reuse\n\t\t// it's configuration set; there's no point in re-computing it.\n\t\t// This is kind of like doing DFA simulation within the ATN\n\t\t// simulation because DFA simulation is really just a way to avoid\n\t\t// computing reach/closure sets. Technically, once we know that\n\t\t// we have a previously added DFA state, we could jump over to\n\t\t// the DFA simulator. But, that would mean popping back and forth\n\t\t// a lot and making things more complicated algorithmically.\n\t\t// This optimization makes a lot of sense for loops within DFA.\n\t\t// A character will take us back to an existing DFA state\n\t\t// that already has lots of edges out of it. e.g., .* in comments.\n\t\t// print(\"Target for:\" + str(s) + \" and:\" + str(t))\n\t\tvar target = this.getExistingTargetState(s, t);\n\t\t// print(\"Existing:\" + str(target))\n\t\tif (target === null) {\n\t\t\ttarget = this.computeTargetState(input, s, t);\n\t\t\t// print(\"Computed:\" + str(target))\n\t\t}\n\t\tif (target === ATNSimulator.ERROR) {\n\t\t\tbreak;\n\t\t}\n\t\t// If this is a consumable input element, make sure to consume before\n\t\t// capturing the accept state so the input index, line, and char\n\t\t// position accurately reflect the state of the interpreter at the\n\t\t// end of the token.\n\t\tif (t !== Token.EOF) {\n\t\t\tthis.consume(input);\n\t\t}\n\t\tif (target.isAcceptState) {\n\t\t\tthis.captureSimState(this.prevAccept, input, target);\n\t\t\tif (t === Token.EOF) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tt = input.LA(1);\n\t\ts = target; // flip; current DFA target becomes new src/from state\n\t}\n\treturn this.failOrAccept(this.prevAccept, input, s.configs, t);\n};\n\n// Get an existing target state for an edge in the DFA. If the target state\n// for the edge has not yet been computed or is otherwise not available,\n// this method returns {@code null}.\n//\n// @param s The current DFA state\n// @param t The next input symbol\n// @return The existing target DFA state for the given input symbol\n// {@code t}, or {@code null} if the target state for this edge is not\n// already cached\nLexerATNSimulator.prototype.getExistingTargetState = function(s, t) {\n\tif (s.edges === null || t < LexerATNSimulator.MIN_DFA_EDGE || t > LexerATNSimulator.MAX_DFA_EDGE) {\n\t\treturn null;\n\t}\n\n\tvar target = s.edges[t - LexerATNSimulator.MIN_DFA_EDGE];\n\tif(target===undefined) {\n\t\ttarget = null;\n\t}\n\tif (LexerATNSimulator.debug && target !== null) {\n\t\tconsole.log(\"reuse state \" + s.stateNumber + \" edge to \" + target.stateNumber);\n\t}\n\treturn target;\n};\n\n// Compute a target state for an edge in the DFA, and attempt to add the\n// computed state and corresponding edge to the DFA.\n//\n// @param input The input stream\n// @param s The current DFA state\n// @param t The next input symbol\n//\n// @return The computed target DFA state for the given input symbol\n// {@code t}. If {@code t} does not lead to a valid DFA state, this method\n// returns {@link //ERROR}.\nLexerATNSimulator.prototype.computeTargetState = function(input, s, t) {\n\tvar reach = new OrderedATNConfigSet();\n\t// if we don't find an existing DFA state\n\t// Fill reach starting from closure, following t transitions\n\tthis.getReachableConfigSet(input, s.configs, reach, t);\n\n\tif (reach.items.length === 0) { // we got nowhere on t from s\n\t\tif (!reach.hasSemanticContext) {\n\t\t\t// we got nowhere on t, don't throw out this knowledge; it'd\n\t\t\t// cause a failover from DFA later.\n\t\t\tthis.addDFAEdge(s, t, ATNSimulator.ERROR);\n\t\t}\n\t\t// stop when we can't match any more char\n\t\treturn ATNSimulator.ERROR;\n\t}\n\t// Add an edge from s to target DFA found/created for reach\n\treturn this.addDFAEdge(s, t, null, reach);\n};\n\nLexerATNSimulator.prototype.failOrAccept = function(prevAccept, input, reach, t) {\n\tif (this.prevAccept.dfaState !== null) {\n\t\tvar lexerActionExecutor = prevAccept.dfaState.lexerActionExecutor;\n\t\tthis.accept(input, lexerActionExecutor, this.startIndex,\n\t\t\t\tprevAccept.index, prevAccept.line, prevAccept.column);\n\t\treturn prevAccept.dfaState.prediction;\n\t} else {\n\t\t// if no accept and EOF is first char, return EOF\n\t\tif (t === Token.EOF && input.index === this.startIndex) {\n\t\t\treturn Token.EOF;\n\t\t}\n\t\tthrow new LexerNoViableAltException(this.recog, input, this.startIndex, reach);\n\t}\n};\n\n// Given a starting configuration set, figure out all ATN configurations\n// we can reach upon input {@code t}. Parameter {@code reach} is a return\n// parameter.\nLexerATNSimulator.prototype.getReachableConfigSet = function(input, closure,\n\t\treach, t) {\n\t// this is used to skip processing for configs which have a lower priority\n\t// than a config that already reached an accept state for the same rule\n\tvar skipAlt = ATN.INVALID_ALT_NUMBER;\n\tfor (var i = 0; i < closure.items.length; i++) {\n\t\tvar cfg = closure.items[i];\n\t\tvar currentAltReachedAcceptState = (cfg.alt === skipAlt);\n\t\tif (currentAltReachedAcceptState && cfg.passedThroughNonGreedyDecision) {\n\t\t\tcontinue;\n\t\t}\n\t\tif (LexerATNSimulator.debug) {\n\t\t\tconsole.log(\"testing %s at %s\\n\", this.getTokenName(t), cfg\n\t\t\t\t\t.toString(this.recog, true));\n\t\t}\n\t\tfor (var j = 0; j < cfg.state.transitions.length; j++) {\n\t\t\tvar trans = cfg.state.transitions[j]; // for each transition\n\t\t\tvar target = this.getReachableTarget(trans, t);\n\t\t\tif (target !== null) {\n\t\t\t\tvar lexerActionExecutor = cfg.lexerActionExecutor;\n\t\t\t\tif (lexerActionExecutor !== null) {\n\t\t\t\t\tlexerActionExecutor = lexerActionExecutor.fixOffsetBeforeMatch(input.index - this.startIndex);\n\t\t\t\t}\n\t\t\t\tvar treatEofAsEpsilon = (t === Token.EOF);\n\t\t\t\tvar config = new LexerATNConfig({state:target, lexerActionExecutor:lexerActionExecutor}, cfg);\n\t\t\t\tif (this.closure(input, config, reach,\n\t\t\t\t\t\tcurrentAltReachedAcceptState, true, treatEofAsEpsilon)) {\n\t\t\t\t\t// any remaining configs for this alt have a lower priority\n\t\t\t\t\t// than the one that just reached an accept state.\n\t\t\t\t\tskipAlt = cfg.alt;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n};\n\nLexerATNSimulator.prototype.accept = function(input, lexerActionExecutor,\n\t\tstartIndex, index, line, charPos) {\n\tif (LexerATNSimulator.debug) {\n\t\tconsole.log(\"ACTION %s\\n\", lexerActionExecutor);\n\t}\n\t// seek to after last char in token\n\tinput.seek(index);\n\tthis.line = line;\n\tthis.column = charPos;\n\tif (lexerActionExecutor !== null && this.recog !== null) {\n\t\tlexerActionExecutor.execute(this.recog, input, startIndex);\n\t}\n};\n\nLexerATNSimulator.prototype.getReachableTarget = function(trans, t) {\n\tif (trans.matches(t, 0, Lexer.MAX_CHAR_VALUE)) {\n\t\treturn trans.target;\n\t} else {\n\t\treturn null;\n\t}\n};\n\nLexerATNSimulator.prototype.computeStartState = function(input, p) {\n\tvar initialContext = PredictionContext.EMPTY;\n\tvar configs = new OrderedATNConfigSet();\n\tfor (var i = 0; i < p.transitions.length; i++) {\n\t\tvar target = p.transitions[i].target;\n        var cfg = new LexerATNConfig({state:target, alt:i+1, context:initialContext}, null);\n\t\tthis.closure(input, cfg, configs, false, false, false);\n\t}\n\treturn configs;\n};\n\n// Since the alternatives within any lexer decision are ordered by\n// preference, this method stops pursuing the closure as soon as an accept\n// state is reached. After the first accept state is reached by depth-first\n// search from {@code config}, all other (potentially reachable) states for\n// this rule would have a lower priority.\n//\n// @return {@code true} if an accept state is reached, otherwise\n// {@code false}.\nLexerATNSimulator.prototype.closure = function(input, config, configs,\n\t\tcurrentAltReachedAcceptState, speculative, treatEofAsEpsilon) {\n\tvar cfg = null;\n\tif (LexerATNSimulator.debug) {\n\t\tconsole.log(\"closure(\" + config.toString(this.recog, true) + \")\");\n\t}\n\tif (config.state instanceof RuleStopState) {\n\t\tif (LexerATNSimulator.debug) {\n\t\t\tif (this.recog !== null) {\n\t\t\t\tconsole.log(\"closure at %s rule stop %s\\n\", this.recog.ruleNames[config.state.ruleIndex], config);\n\t\t\t} else {\n\t\t\t\tconsole.log(\"closure at rule stop %s\\n\", config);\n\t\t\t}\n\t\t}\n\t\tif (config.context === null || config.context.hasEmptyPath()) {\n\t\t\tif (config.context === null || config.context.isEmpty()) {\n\t\t\t\tconfigs.add(config);\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\tconfigs.add(new LexerATNConfig({ state:config.state, context:PredictionContext.EMPTY}, config));\n\t\t\t\tcurrentAltReachedAcceptState = true;\n\t\t\t}\n\t\t}\n\t\tif (config.context !== null && !config.context.isEmpty()) {\n\t\t\tfor (var i = 0; i < config.context.length; i++) {\n\t\t\t\tif (config.context.getReturnState(i) !== PredictionContext.EMPTY_RETURN_STATE) {\n\t\t\t\t\tvar newContext = config.context.getParent(i); // \"pop\" return state\n\t\t\t\t\tvar returnState = this.atn.states[config.context.getReturnState(i)];\n\t\t\t\t\tcfg = new LexerATNConfig({ state:returnState, context:newContext }, config);\n\t\t\t\t\tcurrentAltReachedAcceptState = this.closure(input, cfg,\n\t\t\t\t\t\t\tconfigs, currentAltReachedAcceptState, speculative,\n\t\t\t\t\t\t\ttreatEofAsEpsilon);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn currentAltReachedAcceptState;\n\t}\n\t// optimization\n\tif (!config.state.epsilonOnlyTransitions) {\n\t\tif (!currentAltReachedAcceptState || !config.passedThroughNonGreedyDecision) {\n\t\t\tconfigs.add(config);\n\t\t}\n\t}\n\tfor (var j = 0; j < config.state.transitions.length; j++) {\n\t\tvar trans = config.state.transitions[j];\n\t\tcfg = this.getEpsilonTarget(input, config, trans, configs, speculative, treatEofAsEpsilon);\n\t\tif (cfg !== null) {\n\t\t\tcurrentAltReachedAcceptState = this.closure(input, cfg, configs,\n\t\t\t\t\tcurrentAltReachedAcceptState, speculative, treatEofAsEpsilon);\n\t\t}\n\t}\n\treturn currentAltReachedAcceptState;\n};\n\n// side-effect: can alter configs.hasSemanticContext\nLexerATNSimulator.prototype.getEpsilonTarget = function(input, config, trans,\n\t\tconfigs, speculative, treatEofAsEpsilon) {\n\tvar cfg = null;\n\tif (trans.serializationType === Transition.RULE) {\n\t\tvar newContext = SingletonPredictionContext.create(config.context, trans.followState.stateNumber);\n\t\tcfg = new LexerATNConfig( { state:trans.target, context:newContext}, config);\n\t} else if (trans.serializationType === Transition.PRECEDENCE) {\n\t\tthrow \"Precedence predicates are not supported in lexers.\";\n\t} else if (trans.serializationType === Transition.PREDICATE) {\n\t\t// Track traversing semantic predicates. If we traverse,\n\t\t// we cannot add a DFA state for this \"reach\" computation\n\t\t// because the DFA would not test the predicate again in the\n\t\t// future. Rather than creating collections of semantic predicates\n\t\t// like v3 and testing them on prediction, v4 will test them on the\n\t\t// fly all the time using the ATN not the DFA. This is slower but\n\t\t// semantically it's not used that often. One of the key elements to\n\t\t// this predicate mechanism is not adding DFA states that see\n\t\t// predicates immediately afterwards in the ATN. For example,\n\n\t\t// a : ID {p1}? | ID {p2}? ;\n\n\t\t// should create the start state for rule 'a' (to save start state\n\t\t// competition), but should not create target of ID state. The\n\t\t// collection of ATN states the following ID references includes\n\t\t// states reached by traversing predicates. Since this is when we\n\t\t// test them, we cannot cash the DFA state target of ID.\n\n\t\tif (LexerATNSimulator.debug) {\n\t\t\tconsole.log(\"EVAL rule \" + trans.ruleIndex + \":\" + trans.predIndex);\n\t\t}\n\t\tconfigs.hasSemanticContext = true;\n\t\tif (this.evaluatePredicate(input, trans.ruleIndex, trans.predIndex, speculative)) {\n\t\t\tcfg = new LexerATNConfig({ state:trans.target}, config);\n\t\t}\n\t} else if (trans.serializationType === Transition.ACTION) {\n\t\tif (config.context === null || config.context.hasEmptyPath()) {\n\t\t\t// execute actions anywhere in the start rule for a token.\n\t\t\t//\n\t\t\t// TODO: if the entry rule is invoked recursively, some\n\t\t\t// actions may be executed during the recursive call. The\n\t\t\t// problem can appear when hasEmptyPath() is true but\n\t\t\t// isEmpty() is false. In this case, the config needs to be\n\t\t\t// split into two contexts - one with just the empty path\n\t\t\t// and another with everything but the empty path.\n\t\t\t// Unfortunately, the current algorithm does not allow\n\t\t\t// getEpsilonTarget to return two configurations, so\n\t\t\t// additional modifications are needed before we can support\n\t\t\t// the split operation.\n\t\t\tvar lexerActionExecutor = LexerActionExecutor.append(config.lexerActionExecutor,\n\t\t\t\t\tthis.atn.lexerActions[trans.actionIndex]);\n\t\t\tcfg = new LexerATNConfig({ state:trans.target, lexerActionExecutor:lexerActionExecutor }, config);\n\t\t} else {\n\t\t\t// ignore actions in referenced rules\n\t\t\tcfg = new LexerATNConfig( { state:trans.target}, config);\n\t\t}\n\t} else if (trans.serializationType === Transition.EPSILON) {\n\t\tcfg = new LexerATNConfig({ state:trans.target}, config);\n\t} else if (trans.serializationType === Transition.ATOM ||\n\t\t\t\ttrans.serializationType === Transition.RANGE ||\n\t\t\t\ttrans.serializationType === Transition.SET) {\n\t\tif (treatEofAsEpsilon) {\n\t\t\tif (trans.matches(Token.EOF, 0, Lexer.MAX_CHAR_VALUE)) {\n\t\t\t\tcfg = new LexerATNConfig( { state:trans.target }, config);\n\t\t\t}\n\t\t}\n\t}\n\treturn cfg;\n};\n\n// Evaluate a predicate specified in the lexer.\n//\n// <p>If {@code speculative} is {@code true}, this method was called before\n// {@link //consume} for the matched character. This method should call\n// {@link //consume} before evaluating the predicate to ensure position\n// sensitive values, including {@link Lexer//getText}, {@link Lexer//getLine},\n// and {@link Lexer//getcolumn}, properly reflect the current\n// lexer state. This method should restore {@code input} and the simulator\n// to the original state before returning (i.e. undo the actions made by the\n// call to {@link //consume}.</p>\n//\n// @param input The input stream.\n// @param ruleIndex The rule containing the predicate.\n// @param predIndex The index of the predicate within the rule.\n// @param speculative {@code true} if the current index in {@code input} is\n// one character before the predicate's location.\n//\n// @return {@code true} if the specified predicate evaluates to\n// {@code true}.\n// /\nLexerATNSimulator.prototype.evaluatePredicate = function(input, ruleIndex,\n\t\tpredIndex, speculative) {\n\t// assume true if no recognizer was provided\n\tif (this.recog === null) {\n\t\treturn true;\n\t}\n\tif (!speculative) {\n\t\treturn this.recog.sempred(null, ruleIndex, predIndex);\n\t}\n\tvar savedcolumn = this.column;\n\tvar savedLine = this.line;\n\tvar index = input.index;\n\tvar marker = input.mark();\n\ttry {\n\t\tthis.consume(input);\n\t\treturn this.recog.sempred(null, ruleIndex, predIndex);\n\t} finally {\n\t\tthis.column = savedcolumn;\n\t\tthis.line = savedLine;\n\t\tinput.seek(index);\n\t\tinput.release(marker);\n\t}\n};\n\nLexerATNSimulator.prototype.captureSimState = function(settings, input, dfaState) {\n\tsettings.index = input.index;\n\tsettings.line = this.line;\n\tsettings.column = this.column;\n\tsettings.dfaState = dfaState;\n};\n\nLexerATNSimulator.prototype.addDFAEdge = function(from_, tk, to, cfgs) {\n\tif (to === undefined) {\n\t\tto = null;\n\t}\n\tif (cfgs === undefined) {\n\t\tcfgs = null;\n\t}\n\tif (to === null && cfgs !== null) {\n\t\t// leading to this call, ATNConfigSet.hasSemanticContext is used as a\n\t\t// marker indicating dynamic predicate evaluation makes this edge\n\t\t// dependent on the specific input sequence, so the static edge in the\n\t\t// DFA should be omitted. The target DFAState is still created since\n\t\t// execATN has the ability to resynchronize with the DFA state cache\n\t\t// following the predicate evaluation step.\n\t\t//\n\t\t// TJP notes: next time through the DFA, we see a pred again and eval.\n\t\t// If that gets us to a previously created (but dangling) DFA\n\t\t// state, we can continue in pure DFA mode from there.\n\t\t// /\n\t\tvar suppressEdge = cfgs.hasSemanticContext;\n\t\tcfgs.hasSemanticContext = false;\n\n\t\tto = this.addDFAState(cfgs);\n\n\t\tif (suppressEdge) {\n\t\t\treturn to;\n\t\t}\n\t}\n\t// add the edge\n\tif (tk < LexerATNSimulator.MIN_DFA_EDGE || tk > LexerATNSimulator.MAX_DFA_EDGE) {\n\t\t// Only track edges within the DFA bounds\n\t\treturn to;\n\t}\n\tif (LexerATNSimulator.debug) {\n\t\tconsole.log(\"EDGE \" + from_ + \" -> \" + to + \" upon \" + tk);\n\t}\n\tif (from_.edges === null) {\n\t\t// make room for tokens 1..n and -1 masquerading as index 0\n\t\tfrom_.edges = [];\n\t}\n\tfrom_.edges[tk - LexerATNSimulator.MIN_DFA_EDGE] = to; // connect\n\n\treturn to;\n};\n\n// Add a new DFA state if there isn't one with this set of\n// configurations already. This method also detects the first\n// configuration containing an ATN rule stop state. Later, when\n// traversing the DFA, we will know which rule to accept.\nLexerATNSimulator.prototype.addDFAState = function(configs) {\n\tvar proposed = new DFAState(null, configs);\n\tvar firstConfigWithRuleStopState = null;\n\tfor (var i = 0; i < configs.items.length; i++) {\n\t\tvar cfg = configs.items[i];\n\t\tif (cfg.state instanceof RuleStopState) {\n\t\t\tfirstConfigWithRuleStopState = cfg;\n\t\t\tbreak;\n\t\t}\n\t}\n\tif (firstConfigWithRuleStopState !== null) {\n\t\tproposed.isAcceptState = true;\n\t\tproposed.lexerActionExecutor = firstConfigWithRuleStopState.lexerActionExecutor;\n\t\tproposed.prediction = this.atn.ruleToTokenType[firstConfigWithRuleStopState.state.ruleIndex];\n\t}\n\tvar dfa = this.decisionToDFA[this.mode];\n\tvar existing = dfa.states.get(proposed);\n\tif (existing!==null) {\n\t\treturn existing;\n\t}\n\tvar newState = proposed;\n\tnewState.stateNumber = dfa.states.length;\n\tconfigs.setReadonly(true);\n\tnewState.configs = configs;\n\tdfa.states.add(newState);\n\treturn newState;\n};\n\nLexerATNSimulator.prototype.getDFA = function(mode) {\n\treturn this.decisionToDFA[mode];\n};\n\n// Get the text matched so far for the current token.\nLexerATNSimulator.prototype.getText = function(input) {\n\t// index is first lookahead char, don't include.\n\treturn input.getText(this.startIndex, input.index - 1);\n};\n\nLexerATNSimulator.prototype.consume = function(input) {\n\tvar curChar = input.LA(1);\n\tif (curChar === \"\\n\".charCodeAt(0)) {\n\t\tthis.line += 1;\n\t\tthis.column = 0;\n\t} else {\n\t\tthis.column += 1;\n\t}\n\tinput.consume();\n};\n\nLexerATNSimulator.prototype.getTokenName = function(tt) {\n\tif (tt === -1) {\n\t\treturn \"EOF\";\n\t} else {\n\t\treturn \"'\" + String.fromCharCode(tt) + \"'\";\n\t}\n};\n\nexports.LexerATNSimulator = LexerATNSimulator;\n","//\n/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n //\n\nfunction LexerActionType() {\n}\n\nLexerActionType.CHANNEL = 0;     //The type of a {@link LexerChannelAction} action.\nLexerActionType.CUSTOM = 1;      //The type of a {@link LexerCustomAction} action.\nLexerActionType.MODE = 2;        //The type of a {@link LexerModeAction} action.\nLexerActionType.MORE = 3;        //The type of a {@link LexerMoreAction} action.\nLexerActionType.POP_MODE = 4;    //The type of a {@link LexerPopModeAction} action.\nLexerActionType.PUSH_MODE = 5;   //The type of a {@link LexerPushModeAction} action.\nLexerActionType.SKIP = 6;        //The type of a {@link LexerSkipAction} action.\nLexerActionType.TYPE = 7;        //The type of a {@link LexerTypeAction} action.\n\nfunction LexerAction(action) {\n    this.actionType = action;\n    this.isPositionDependent = false;\n    return this;\n}\n\nLexerAction.prototype.hashCode = function() {\n    var hash = new Hash();\n    this.updateHashCode(hash);\n    return hash.finish()\n};\n\nLexerAction.prototype.updateHashCode = function(hash) {\n    hash.update(this.actionType);\n};\n\nLexerAction.prototype.equals = function(other) {\n    return this === other;\n};\n\n\n\n//\n// Implements the {@code skip} lexer action by calling {@link Lexer//skip}.\n//\n// <p>The {@code skip} command does not have any parameters, so this action is\n// implemented as a singleton instance exposed by {@link //INSTANCE}.</p>\nfunction LexerSkipAction() {\n\tLexerAction.call(this, LexerActionType.SKIP);\n\treturn this;\n}\n\nLexerSkipAction.prototype = Object.create(LexerAction.prototype);\nLexerSkipAction.prototype.constructor = LexerSkipAction;\n\n// Provides a singleton instance of this parameterless lexer action.\nLexerSkipAction.INSTANCE = new LexerSkipAction();\n\nLexerSkipAction.prototype.execute = function(lexer) {\n    lexer.skip();\n};\n\nLexerSkipAction.prototype.toString = function() {\n\treturn \"skip\";\n};\n\n//  Implements the {@code type} lexer action by calling {@link Lexer//setType}\n// with the assigned type.\nfunction LexerTypeAction(type) {\n\tLexerAction.call(this, LexerActionType.TYPE);\n\tthis.type = type;\n\treturn this;\n}\n\nLexerTypeAction.prototype = Object.create(LexerAction.prototype);\nLexerTypeAction.prototype.constructor = LexerTypeAction;\n\nLexerTypeAction.prototype.execute = function(lexer) {\n    lexer.type = this.type;\n};\n\nLexerTypeAction.prototype.updateHashCode = function(hash) {\n    hash.update(this.actionType, this.type);\n};\n\n\nLexerTypeAction.prototype.equals = function(other) {\n    if(this === other) {\n        return true;\n    } else if (! (other instanceof LexerTypeAction)) {\n        return false;\n    } else {\n        return this.type === other.type;\n    }\n};\n\nLexerTypeAction.prototype.toString = function() {\n    return \"type(\" + this.type + \")\";\n};\n\n// Implements the {@code pushMode} lexer action by calling\n// {@link Lexer//pushMode} with the assigned mode.\nfunction LexerPushModeAction(mode) {\n\tLexerAction.call(this, LexerActionType.PUSH_MODE);\n    this.mode = mode;\n    return this;\n}\n\nLexerPushModeAction.prototype = Object.create(LexerAction.prototype);\nLexerPushModeAction.prototype.constructor = LexerPushModeAction;\n\n// <p>This action is implemented by calling {@link Lexer//pushMode} with the\n// value provided by {@link //getMode}.</p>\nLexerPushModeAction.prototype.execute = function(lexer) {\n    lexer.pushMode(this.mode);\n};\n\nLexerPushModeAction.prototype.updateHashCode = function(hash) {\n    hash.update(this.actionType, this.mode);\n};\n\nLexerPushModeAction.prototype.equals = function(other) {\n    if (this === other) {\n        return true;\n    } else if (! (other instanceof LexerPushModeAction)) {\n        return false;\n    } else {\n        return this.mode === other.mode;\n    }\n};\n\nLexerPushModeAction.prototype.toString = function() {\n\treturn \"pushMode(\" + this.mode + \")\";\n};\n\n\n// Implements the {@code popMode} lexer action by calling {@link Lexer//popMode}.\n//\n// <p>The {@code popMode} command does not have any parameters, so this action is\n// implemented as a singleton instance exposed by {@link //INSTANCE}.</p>\nfunction LexerPopModeAction() {\n\tLexerAction.call(this,LexerActionType.POP_MODE);\n\treturn this;\n}\n\nLexerPopModeAction.prototype = Object.create(LexerAction.prototype);\nLexerPopModeAction.prototype.constructor = LexerPopModeAction;\n\nLexerPopModeAction.INSTANCE = new LexerPopModeAction();\n\n// <p>This action is implemented by calling {@link Lexer//popMode}.</p>\nLexerPopModeAction.prototype.execute = function(lexer) {\n    lexer.popMode();\n};\n\nLexerPopModeAction.prototype.toString = function() {\n\treturn \"popMode\";\n};\n\n// Implements the {@code more} lexer action by calling {@link Lexer//more}.\n//\n// <p>The {@code more} command does not have any parameters, so this action is\n// implemented as a singleton instance exposed by {@link //INSTANCE}.</p>\nfunction LexerMoreAction() {\n\tLexerAction.call(this, LexerActionType.MORE);\n\treturn this;\n}\n\nLexerMoreAction.prototype = Object.create(LexerAction.prototype);\nLexerMoreAction.prototype.constructor = LexerMoreAction;\n\nLexerMoreAction.INSTANCE = new LexerMoreAction();\n\n// <p>This action is implemented by calling {@link Lexer//popMode}.</p>\nLexerMoreAction.prototype.execute = function(lexer) {\n    lexer.more();\n};\n\nLexerMoreAction.prototype.toString = function() {\n    return \"more\";\n};\n\n\n// Implements the {@code mode} lexer action by calling {@link Lexer//mode} with\n// the assigned mode.\nfunction LexerModeAction(mode) {\n\tLexerAction.call(this, LexerActionType.MODE);\n    this.mode = mode;\n    return this;\n}\n\nLexerModeAction.prototype = Object.create(LexerAction.prototype);\nLexerModeAction.prototype.constructor = LexerModeAction;\n\n// <p>This action is implemented by calling {@link Lexer//mode} with the\n// value provided by {@link //getMode}.</p>\nLexerModeAction.prototype.execute = function(lexer) {\n    lexer.mode(this.mode);\n};\n\nLexerModeAction.prototype.updateHashCode = function(hash) {\n    hash.update(this.actionType, this.mode);\n};\n\nLexerModeAction.prototype.equals = function(other) {\n    if (this === other) {\n        return true;\n    } else if (! (other instanceof LexerModeAction)) {\n        return false;\n    } else {\n        return this.mode === other.mode;\n    }\n};\n\nLexerModeAction.prototype.toString = function() {\n    return \"mode(\" + this.mode + \")\";\n};\n\n// Executes a custom lexer action by calling {@link Recognizer//action} with the\n// rule and action indexes assigned to the custom action. The implementation of\n// a custom action is added to the generated code for the lexer in an override\n// of {@link Recognizer//action} when the grammar is compiled.\n//\n// <p>This class may represent embedded actions created with the <code>{...}</code>\n// syntax in ANTLR 4, as well as actions created for lexer commands where the\n// command argument could not be evaluated when the grammar was compiled.</p>\n\n\n    // Constructs a custom lexer action with the specified rule and action\n    // indexes.\n    //\n    // @param ruleIndex The rule index to use for calls to\n    // {@link Recognizer//action}.\n    // @param actionIndex The action index to use for calls to\n    // {@link Recognizer//action}.\n\nfunction LexerCustomAction(ruleIndex, actionIndex) {\n\tLexerAction.call(this, LexerActionType.CUSTOM);\n    this.ruleIndex = ruleIndex;\n    this.actionIndex = actionIndex;\n    this.isPositionDependent = true;\n    return this;\n}\n\nLexerCustomAction.prototype = Object.create(LexerAction.prototype);\nLexerCustomAction.prototype.constructor = LexerCustomAction;\n\n// <p>Custom actions are implemented by calling {@link Lexer//action} with the\n// appropriate rule and action indexes.</p>\nLexerCustomAction.prototype.execute = function(lexer) {\n    lexer.action(null, this.ruleIndex, this.actionIndex);\n};\n\nLexerCustomAction.prototype.updateHashCode = function(hash) {\n    hash.update(this.actionType, this.ruleIndex, this.actionIndex);\n};\n\nLexerCustomAction.prototype.equals = function(other) {\n    if (this === other) {\n        return true;\n    } else if (! (other instanceof LexerCustomAction)) {\n        return false;\n    } else {\n        return this.ruleIndex === other.ruleIndex && this.actionIndex === other.actionIndex;\n    }\n};\n\n// Implements the {@code channel} lexer action by calling\n// {@link Lexer//setChannel} with the assigned channel.\n// Constructs a new {@code channel} action with the specified channel value.\n// @param channel The channel value to pass to {@link Lexer//setChannel}.\nfunction LexerChannelAction(channel) {\n\tLexerAction.call(this, LexerActionType.CHANNEL);\n    this.channel = channel;\n    return this;\n}\n\nLexerChannelAction.prototype = Object.create(LexerAction.prototype);\nLexerChannelAction.prototype.constructor = LexerChannelAction;\n\n// <p>This action is implemented by calling {@link Lexer//setChannel} with the\n// value provided by {@link //getChannel}.</p>\nLexerChannelAction.prototype.execute = function(lexer) {\n    lexer._channel = this.channel;\n};\n\nLexerChannelAction.prototype.updateHashCode = function(hash) {\n    hash.update(this.actionType, this.channel);\n};\n\nLexerChannelAction.prototype.equals = function(other) {\n    if (this === other) {\n        return true;\n    } else if (! (other instanceof LexerChannelAction)) {\n        return false;\n    } else {\n        return this.channel === other.channel;\n    }\n};\n\nLexerChannelAction.prototype.toString = function() {\n    return \"channel(\" + this.channel + \")\";\n};\n\n// This implementation of {@link LexerAction} is used for tracking input offsets\n// for position-dependent actions within a {@link LexerActionExecutor}.\n//\n// <p>This action is not serialized as part of the ATN, and is only required for\n// position-dependent lexer actions which appear at a location other than the\n// end of a rule. For more information about DFA optimizations employed for\n// lexer actions, see {@link LexerActionExecutor//append} and\n// {@link LexerActionExecutor//fixOffsetBeforeMatch}.</p>\n\n// Constructs a new indexed custom action by associating a character offset\n// with a {@link LexerAction}.\n//\n// <p>Note: This class is only required for lexer actions for which\n// {@link LexerAction//isPositionDependent} returns {@code true}.</p>\n//\n// @param offset The offset into the input {@link CharStream}, relative to\n// the token start index, at which the specified lexer action should be\n// executed.\n// @param action The lexer action to execute at a particular offset in the\n// input {@link CharStream}.\nfunction LexerIndexedCustomAction(offset, action) {\n\tLexerAction.call(this, action.actionType);\n    this.offset = offset;\n    this.action = action;\n    this.isPositionDependent = true;\n    return this;\n}\n\nLexerIndexedCustomAction.prototype = Object.create(LexerAction.prototype);\nLexerIndexedCustomAction.prototype.constructor = LexerIndexedCustomAction;\n\n// <p>This method calls {@link //execute} on the result of {@link //getAction}\n// using the provided {@code lexer}.</p>\nLexerIndexedCustomAction.prototype.execute = function(lexer) {\n    // assume the input stream position was properly set by the calling code\n    this.action.execute(lexer);\n};\n\nLexerIndexedCustomAction.prototype.updateHashCode = function(hash) {\n    hash.update(this.actionType, this.offset, this.action);\n};\n\nLexerIndexedCustomAction.prototype.equals = function(other) {\n    if (this === other) {\n        return true;\n    } else if (! (other instanceof LexerIndexedCustomAction)) {\n        return false;\n    } else {\n        return this.offset === other.offset && this.action === other.action;\n    }\n};\n\n\nexports.LexerActionType = LexerActionType;\nexports.LexerSkipAction = LexerSkipAction;\nexports.LexerChannelAction = LexerChannelAction;\nexports.LexerCustomAction = LexerCustomAction;\nexports.LexerIndexedCustomAction = LexerIndexedCustomAction;\nexports.LexerMoreAction = LexerMoreAction;\nexports.LexerTypeAction = LexerTypeAction;\nexports.LexerPushModeAction = LexerPushModeAction;\nexports.LexerPopModeAction = LexerPopModeAction;\nexports.LexerModeAction = LexerModeAction;","//\n/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n///\n\n// Represents an executor for a sequence of lexer actions which traversed during\n// the matching operation of a lexer rule (token).\n//\n// <p>The executor tracks position information for position-dependent lexer actions\n// efficiently, ensuring that actions appearing only at the end of the rule do\n// not cause bloating of the {@link DFA} created for the lexer.</p>\n\nvar hashStuff = require(\"../Utils\").hashStuff;\nvar LexerIndexedCustomAction = require('./LexerAction').LexerIndexedCustomAction;\n\nfunction LexerActionExecutor(lexerActions) {\n\tthis.lexerActions = lexerActions === null ? [] : lexerActions;\n\t// Caches the result of {@link //hashCode} since the hash code is an element\n\t// of the performance-critical {@link LexerATNConfig//hashCode} operation.\n\tthis.cachedHashCode = hashStuff(lexerActions); // \"\".join([str(la) for la in\n\t// lexerActions]))\n\treturn this;\n}\n\n// Creates a {@link LexerActionExecutor} which executes the actions for\n// the input {@code lexerActionExecutor} followed by a specified\n// {@code lexerAction}.\n//\n// @param lexerActionExecutor The executor for actions already traversed by\n// the lexer while matching a token within a particular\n// {@link LexerATNConfig}. If this is {@code null}, the method behaves as\n// though it were an empty executor.\n// @param lexerAction The lexer action to execute after the actions\n// specified in {@code lexerActionExecutor}.\n//\n// @return A {@link LexerActionExecutor} for executing the combine actions\n// of {@code lexerActionExecutor} and {@code lexerAction}.\nLexerActionExecutor.append = function(lexerActionExecutor, lexerAction) {\n\tif (lexerActionExecutor === null) {\n\t\treturn new LexerActionExecutor([ lexerAction ]);\n\t}\n\tvar lexerActions = lexerActionExecutor.lexerActions.concat([ lexerAction ]);\n\treturn new LexerActionExecutor(lexerActions);\n};\n\n// Creates a {@link LexerActionExecutor} which encodes the current offset\n// for position-dependent lexer actions.\n//\n// <p>Normally, when the executor encounters lexer actions where\n// {@link LexerAction//isPositionDependent} returns {@code true}, it calls\n// {@link IntStream//seek} on the input {@link CharStream} to set the input\n// position to the <em>end</em> of the current token. This behavior provides\n// for efficient DFA representation of lexer actions which appear at the end\n// of a lexer rule, even when the lexer rule matches a variable number of\n// characters.</p>\n//\n// <p>Prior to traversing a match transition in the ATN, the current offset\n// from the token start index is assigned to all position-dependent lexer\n// actions which have not already been assigned a fixed offset. By storing\n// the offsets relative to the token start index, the DFA representation of\n// lexer actions which appear in the middle of tokens remains efficient due\n// to sharing among tokens of the same length, regardless of their absolute\n// position in the input stream.</p>\n//\n// <p>If the current executor already has offsets assigned to all\n// position-dependent lexer actions, the method returns {@code this}.</p>\n//\n// @param offset The current offset to assign to all position-dependent\n// lexer actions which do not already have offsets assigned.\n//\n// @return A {@link LexerActionExecutor} which stores input stream offsets\n// for all position-dependent lexer actions.\n// /\nLexerActionExecutor.prototype.fixOffsetBeforeMatch = function(offset) {\n\tvar updatedLexerActions = null;\n\tfor (var i = 0; i < this.lexerActions.length; i++) {\n\t\tif (this.lexerActions[i].isPositionDependent &&\n\t\t\t\t!(this.lexerActions[i] instanceof LexerIndexedCustomAction)) {\n\t\t\tif (updatedLexerActions === null) {\n\t\t\t\tupdatedLexerActions = this.lexerActions.concat([]);\n\t\t\t}\n\t\t\tupdatedLexerActions[i] = new LexerIndexedCustomAction(offset,\n\t\t\t\t\tthis.lexerActions[i]);\n\t\t}\n\t}\n\tif (updatedLexerActions === null) {\n\t\treturn this;\n\t} else {\n\t\treturn new LexerActionExecutor(updatedLexerActions);\n\t}\n};\n\n// Execute the actions encapsulated by this executor within the context of a\n// particular {@link Lexer}.\n//\n// <p>This method calls {@link IntStream//seek} to set the position of the\n// {@code input} {@link CharStream} prior to calling\n// {@link LexerAction//execute} on a position-dependent action. Before the\n// method returns, the input position will be restored to the same position\n// it was in when the method was invoked.</p>\n//\n// @param lexer The lexer instance.\n// @param input The input stream which is the source for the current token.\n// When this method is called, the current {@link IntStream//index} for\n// {@code input} should be the start of the following token, i.e. 1\n// character past the end of the current token.\n// @param startIndex The token start index. This value may be passed to\n// {@link IntStream//seek} to set the {@code input} position to the beginning\n// of the token.\n// /\nLexerActionExecutor.prototype.execute = function(lexer, input, startIndex) {\n\tvar requiresSeek = false;\n\tvar stopIndex = input.index;\n\ttry {\n\t\tfor (var i = 0; i < this.lexerActions.length; i++) {\n\t\t\tvar lexerAction = this.lexerActions[i];\n\t\t\tif (lexerAction instanceof LexerIndexedCustomAction) {\n\t\t\t\tvar offset = lexerAction.offset;\n\t\t\t\tinput.seek(startIndex + offset);\n\t\t\t\tlexerAction = lexerAction.action;\n\t\t\t\trequiresSeek = (startIndex + offset) !== stopIndex;\n\t\t\t} else if (lexerAction.isPositionDependent) {\n\t\t\t\tinput.seek(stopIndex);\n\t\t\t\trequiresSeek = false;\n\t\t\t}\n\t\t\tlexerAction.execute(lexer);\n\t\t}\n\t} finally {\n\t\tif (requiresSeek) {\n\t\t\tinput.seek(stopIndex);\n\t\t}\n\t}\n};\n\nLexerActionExecutor.prototype.hashCode = function() {\n\treturn this.cachedHashCode;\n};\n\nLexerActionExecutor.prototype.updateHashCode = function(hash) {\n    hash.update(this.cachedHashCode);\n};\n\n\nLexerActionExecutor.prototype.equals = function(other) {\n\tif (this === other) {\n\t\treturn true;\n\t} else if (!(other instanceof LexerActionExecutor)) {\n\t\treturn false;\n\t} else if (this.cachedHashCode != other.cachedHashCode) {\n\t\treturn false;\n\t} else if (this.lexerActions.length != other.lexerActions.length) {\n\t\treturn false;\n\t} else {\n\t\tvar numActions = this.lexerActions.length\n\t\tfor (var idx = 0; idx < numActions; ++idx) {\n\t\t\tif (!this.lexerActions[idx].equals(other.lexerActions[idx])) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n};\n\nexports.LexerActionExecutor = LexerActionExecutor;\n","//\n/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n//\n\n//\n// The embodiment of the adaptive LL(*), ALL(*), parsing strategy.\n//\n// <p>\n// The basic complexity of the adaptive strategy makes it harder to understand.\n// We begin with ATN simulation to build paths in a DFA. Subsequent prediction\n// requests go through the DFA first. If they reach a state without an edge for\n// the current symbol, the algorithm fails over to the ATN simulation to\n// complete the DFA path for the current input (until it finds a conflict state\n// or uniquely predicting state).</p>\n//\n// <p>\n// All of that is done without using the outer context because we want to create\n// a DFA that is not dependent upon the rule invocation stack when we do a\n// prediction. One DFA works in all contexts. We avoid using context not\n// necessarily because it's slower, although it can be, but because of the DFA\n// caching problem. The closure routine only considers the rule invocation stack\n// created during prediction beginning in the decision rule. For example, if\n// prediction occurs without invoking another rule's ATN, there are no context\n// stacks in the configurations. When lack of context leads to a conflict, we\n// don't know if it's an ambiguity or a weakness in the strong LL(*) parsing\n// strategy (versus full LL(*)).</p>\n//\n// <p>\n// When SLL yields a configuration set with conflict, we rewind the input and\n// retry the ATN simulation, this time using full outer context without adding\n// to the DFA. Configuration context stacks will be the full invocation stacks\n// from the start rule. If we get a conflict using full context, then we can\n// definitively say we have a true ambiguity for that input sequence. If we\n// don't get a conflict, it implies that the decision is sensitive to the outer\n// context. (It is not context-sensitive in the sense of context-sensitive\n// grammars.)</p>\n//\n// <p>\n// The next time we reach this DFA state with an SLL conflict, through DFA\n// simulation, we will again retry the ATN simulation using full context mode.\n// This is slow because we can't save the results and have to \"interpret\" the\n// ATN each time we get that input.</p>\n//\n// <p>\n// <strong>CACHING FULL CONTEXT PREDICTIONS</strong></p>\n//\n// <p>\n// We could cache results from full context to predicted alternative easily and\n// that saves a lot of time but doesn't work in presence of predicates. The set\n// of visible predicates from the ATN start state changes depending on the\n// context, because closure can fall off the end of a rule. I tried to cache\n// tuples (stack context, semantic context, predicted alt) but it was slower\n// than interpreting and much more complicated. Also required a huge amount of\n// memory. The goal is not to create the world's fastest parser anyway. I'd like\n// to keep this algorithm simple. By launching multiple threads, we can improve\n// the speed of parsing across a large number of files.</p>\n//\n// <p>\n// There is no strict ordering between the amount of input used by SLL vs LL,\n// which makes it really hard to build a cache for full context. Let's say that\n// we have input A B C that leads to an SLL conflict with full context X. That\n// implies that using X we might only use A B but we could also use A B C D to\n// resolve conflict. Input A B C D could predict alternative 1 in one position\n// in the input and A B C E could predict alternative 2 in another position in\n// input. The conflicting SLL configurations could still be non-unique in the\n// full context prediction, which would lead us to requiring more input than the\n// original A B C.\tTo make a\tprediction cache work, we have to track\tthe exact\n// input\tused during the previous prediction. That amounts to a cache that maps\n// X to a specific DFA for that context.</p>\n//\n// <p>\n// Something should be done for left-recursive expression predictions. They are\n// likely LL(1) + pred eval. Easier to do the whole SLL unless error and retry\n// with full LL thing Sam does.</p>\n//\n// <p>\n// <strong>AVOIDING FULL CONTEXT PREDICTION</strong></p>\n//\n// <p>\n// We avoid doing full context retry when the outer context is empty, we did not\n// dip into the outer context by falling off the end of the decision state rule,\n// or when we force SLL mode.</p>\n//\n// <p>\n// As an example of the not dip into outer context case, consider as super\n// constructor calls versus function calls. One grammar might look like\n// this:</p>\n//\n// <pre>\n// ctorBody\n//   : '{' superCall? stat* '}'\n//   ;\n// </pre>\n//\n// <p>\n// Or, you might see something like</p>\n//\n// <pre>\n// stat\n//   : superCall ';'\n//   | expression ';'\n//   | ...\n//   ;\n// </pre>\n//\n// <p>\n// In both cases I believe that no closure operations will dip into the outer\n// context. In the first case ctorBody in the worst case will stop at the '}'.\n// In the 2nd case it should stop at the ';'. Both cases should stay within the\n// entry rule and not dip into the outer context.</p>\n//\n// <p>\n// <strong>PREDICATES</strong></p>\n//\n// <p>\n// Predicates are always evaluated if present in either SLL or LL both. SLL and\n// LL simulation deals with predicates differently. SLL collects predicates as\n// it performs closure operations like ANTLR v3 did. It delays predicate\n// evaluation until it reaches and accept state. This allows us to cache the SLL\n// ATN simulation whereas, if we had evaluated predicates on-the-fly during\n// closure, the DFA state configuration sets would be different and we couldn't\n// build up a suitable DFA.</p>\n//\n// <p>\n// When building a DFA accept state during ATN simulation, we evaluate any\n// predicates and return the sole semantically valid alternative. If there is\n// more than 1 alternative, we report an ambiguity. If there are 0 alternatives,\n// we throw an exception. Alternatives without predicates act like they have\n// true predicates. The simple way to think about it is to strip away all\n// alternatives with false predicates and choose the minimum alternative that\n// remains.</p>\n//\n// <p>\n// When we start in the DFA and reach an accept state that's predicated, we test\n// those and return the minimum semantically viable alternative. If no\n// alternatives are viable, we throw an exception.</p>\n//\n// <p>\n// During full LL ATN simulation, closure always evaluates predicates and\n// on-the-fly. This is crucial to reducing the configuration set size during\n// closure. It hits a landmine when parsing with the Java grammar, for example,\n// without this on-the-fly evaluation.</p>\n//\n// <p>\n// <strong>SHARING DFA</strong></p>\n//\n// <p>\n// All instances of the same parser share the same decision DFAs through a\n// static field. Each instance gets its own ATN simulator but they share the\n// same {@link //decisionToDFA} field. They also share a\n// {@link PredictionContextCache} object that makes sure that all\n// {@link PredictionContext} objects are shared among the DFA states. This makes\n// a big size difference.</p>\n//\n// <p>\n// <strong>THREAD SAFETY</strong></p>\n//\n// <p>\n// The {@link ParserATNSimulator} locks on the {@link //decisionToDFA} field when\n// it adds a new DFA object to that array. {@link //addDFAEdge}\n// locks on the DFA for the current decision when setting the\n// {@link DFAState//edges} field. {@link //addDFAState} locks on\n// the DFA for the current decision when looking up a DFA state to see if it\n// already exists. We must make sure that all requests to add DFA states that\n// are equivalent result in the same shared DFA object. This is because lots of\n// threads will be trying to update the DFA at once. The\n// {@link //addDFAState} method also locks inside the DFA lock\n// but this time on the shared context cache when it rebuilds the\n// configurations' {@link PredictionContext} objects using cached\n// subgraphs/nodes. No other locking occurs, even during DFA simulation. This is\n// safe as long as we can guarantee that all threads referencing\n// {@code s.edge[t]} get the same physical target {@link DFAState}, or\n// {@code null}. Once into the DFA, the DFA simulation does not reference the\n// {@link DFA//states} map. It follows the {@link DFAState//edges} field to new\n// targets. The DFA simulator will either find {@link DFAState//edges} to be\n// {@code null}, to be non-{@code null} and {@code dfa.edges[t]} null, or\n// {@code dfa.edges[t]} to be non-null. The\n// {@link //addDFAEdge} method could be racing to set the field\n// but in either case the DFA simulator works; if {@code null}, and requests ATN\n// simulation. It could also race trying to get {@code dfa.edges[t]}, but either\n// way it will work because it's not doing a test and set operation.</p>\n//\n// <p>\n// <strong>Starting with SLL then failing to combined SLL/LL (Two-Stage\n// Parsing)</strong></p>\n//\n// <p>\n// Sam pointed out that if SLL does not give a syntax error, then there is no\n// point in doing full LL, which is slower. We only have to try LL if we get a\n// syntax error. For maximum speed, Sam starts the parser set to pure SLL\n// mode with the {@link BailErrorStrategy}:</p>\n//\n// <pre>\n// parser.{@link Parser//getInterpreter() getInterpreter()}.{@link //setPredictionMode setPredictionMode}{@code (}{@link PredictionMode//SLL}{@code )};\n// parser.{@link Parser//setErrorHandler setErrorHandler}(new {@link BailErrorStrategy}());\n// </pre>\n//\n// <p>\n// If it does not get a syntax error, then we're done. If it does get a syntax\n// error, we need to retry with the combined SLL/LL strategy.</p>\n//\n// <p>\n// The reason this works is as follows. If there are no SLL conflicts, then the\n// grammar is SLL (at least for that input set). If there is an SLL conflict,\n// the full LL analysis must yield a set of viable alternatives which is a\n// subset of the alternatives reported by SLL. If the LL set is a singleton,\n// then the grammar is LL but not SLL. If the LL set is the same size as the SLL\n// set, the decision is SLL. If the LL set has size &gt; 1, then that decision\n// is truly ambiguous on the current input. If the LL set is smaller, then the\n// SLL conflict resolution might choose an alternative that the full LL would\n// rule out as a possibility based upon better context information. If that's\n// the case, then the SLL parse will definitely get an error because the full LL\n// analysis says it's not viable. If SLL conflict resolution chooses an\n// alternative within the LL set, them both SLL and LL would choose the same\n// alternative because they both choose the minimum of multiple conflicting\n// alternatives.</p>\n//\n// <p>\n// Let's say we have a set of SLL conflicting alternatives {@code {1, 2, 3}} and\n// a smaller LL set called <em>s</em>. If <em>s</em> is {@code {2, 3}}, then SLL\n// parsing will get an error because SLL will pursue alternative 1. If\n// <em>s</em> is {@code {1, 2}} or {@code {1, 3}} then both SLL and LL will\n// choose the same alternative because alternative one is the minimum of either\n// set. If <em>s</em> is {@code {2}} or {@code {3}} then SLL will get a syntax\n// error. If <em>s</em> is {@code {1}} then SLL will succeed.</p>\n//\n// <p>\n// Of course, if the input is invalid, then we will get an error for sure in\n// both SLL and LL parsing. Erroneous input will therefore require 2 passes over\n// the input.</p>\n//\n\nvar Utils = require('./../Utils');\nvar Set = Utils.Set;\nvar BitSet = Utils.BitSet;\nvar DoubleDict = Utils.DoubleDict;\nvar ATN = require('./ATN').ATN;\nvar ATNState = require('./ATNState').ATNState;\nvar ATNConfig = require('./ATNConfig').ATNConfig;\nvar ATNConfigSet = require('./ATNConfigSet').ATNConfigSet;\nvar Token = require('./../Token').Token;\nvar DFAState = require('./../dfa/DFAState').DFAState;\nvar PredPrediction = require('./../dfa/DFAState').PredPrediction;\nvar ATNSimulator = require('./ATNSimulator').ATNSimulator;\nvar PredictionMode = require('./PredictionMode').PredictionMode;\nvar RuleContext = require('./../RuleContext').RuleContext;\nvar ParserRuleContext = require('./../ParserRuleContext').ParserRuleContext;\nvar SemanticContext = require('./SemanticContext').SemanticContext;\nvar StarLoopEntryState = require('./ATNState').StarLoopEntryState;\nvar RuleStopState = require('./ATNState').RuleStopState;\nvar PredictionContext = require('./../PredictionContext').PredictionContext;\nvar Interval = require('./../IntervalSet').Interval;\nvar Transitions = require('./Transition');\nvar Transition = Transitions.Transition;\nvar SetTransition = Transitions.SetTransition;\nvar NotSetTransition = Transitions.NotSetTransition;\nvar RuleTransition = Transitions.RuleTransition;\nvar ActionTransition = Transitions.ActionTransition;\nvar NoViableAltException = require('./../error/Errors').NoViableAltException;\n\nvar SingletonPredictionContext = require('./../PredictionContext').SingletonPredictionContext;\nvar predictionContextFromRuleContext = require('./../PredictionContext').predictionContextFromRuleContext;\n\nfunction ParserATNSimulator(parser, atn, decisionToDFA, sharedContextCache) {\n\tATNSimulator.call(this, atn, sharedContextCache);\n    this.parser = parser;\n    this.decisionToDFA = decisionToDFA;\n    // SLL, LL, or LL + exact ambig detection?//\n    this.predictionMode = PredictionMode.LL;\n    // LAME globals to avoid parameters!!!!! I need these down deep in predTransition\n    this._input = null;\n    this._startIndex = 0;\n    this._outerContext = null;\n    this._dfa = null;\n    // Each prediction operation uses a cache for merge of prediction contexts.\n    //  Don't keep around as it wastes huge amounts of memory. DoubleKeyMap\n    //  isn't synchronized but we're ok since two threads shouldn't reuse same\n    //  parser/atnsim object because it can only handle one input at a time.\n    //  This maps graphs a and b to merged result c. (a,b)&rarr;c. We can avoid\n    //  the merge if we ever see a and b again.  Note that (b,a)&rarr;c should\n    //  also be examined during cache lookup.\n    //\n    this.mergeCache = null;\n    return this;\n}\n\nParserATNSimulator.prototype = Object.create(ATNSimulator.prototype);\nParserATNSimulator.prototype.constructor = ParserATNSimulator;\n\nParserATNSimulator.prototype.debug = false;\nParserATNSimulator.prototype.debug_closure = false;\nParserATNSimulator.prototype.debug_add = false;\nParserATNSimulator.prototype.debug_list_atn_decisions = false;\nParserATNSimulator.prototype.dfa_debug = false;\nParserATNSimulator.prototype.retry_debug = false;\n\n\nParserATNSimulator.prototype.reset = function() {\n};\n\nParserATNSimulator.prototype.adaptivePredict = function(input, decision, outerContext) {\n    if (this.debug || this.debug_list_atn_decisions) {\n        console.log(\"adaptivePredict decision \" + decision +\n                               \" exec LA(1)==\" + this.getLookaheadName(input) +\n                               \" line \" + input.LT(1).line + \":\" +\n                               input.LT(1).column);\n    }\n    this._input = input;\n    this._startIndex = input.index;\n    this._outerContext = outerContext;\n\n    var dfa = this.decisionToDFA[decision];\n    this._dfa = dfa;\n    var m = input.mark();\n    var index = input.index;\n\n    // Now we are certain to have a specific decision's DFA\n    // But, do we still need an initial state?\n    try {\n        var s0;\n        if (dfa.precedenceDfa) {\n            // the start state for a precedence DFA depends on the current\n            // parser precedence, and is provided by a DFA method.\n            s0 = dfa.getPrecedenceStartState(this.parser.getPrecedence());\n        } else {\n            // the start state for a \"regular\" DFA is just s0\n            s0 = dfa.s0;\n        }\n        if (s0===null) {\n            if (outerContext===null) {\n                outerContext = RuleContext.EMPTY;\n            }\n            if (this.debug || this.debug_list_atn_decisions) {\n                console.log(\"predictATN decision \" + dfa.decision +\n                                   \" exec LA(1)==\" + this.getLookaheadName(input) +\n                                   \", outerContext=\" + outerContext.toString(this.parser.ruleNames));\n            }\n\n            var fullCtx = false;\n            var s0_closure = this.computeStartState(dfa.atnStartState, RuleContext.EMPTY, fullCtx);\n\n            if( dfa.precedenceDfa) {\n                // If this is a precedence DFA, we use applyPrecedenceFilter\n                // to convert the computed start state to a precedence start\n                // state. We then use DFA.setPrecedenceStartState to set the\n                // appropriate start state for the precedence level rather\n                // than simply setting DFA.s0.\n                //\n                dfa.s0.configs = s0_closure; // not used for prediction but useful to know start configs anyway\n                s0_closure = this.applyPrecedenceFilter(s0_closure);\n                s0 = this.addDFAState(dfa, new DFAState(null, s0_closure));\n                dfa.setPrecedenceStartState(this.parser.getPrecedence(), s0);\n            } else {\n                s0 = this.addDFAState(dfa, new DFAState(null, s0_closure));\n                dfa.s0 = s0;\n            }\n        }\n        var alt = this.execATN(dfa, s0, input, index, outerContext);\n        if (this.debug) {\n            console.log(\"DFA after predictATN: \" + dfa.toString(this.parser.literalNames));\n        }\n        return alt;\n    } finally {\n        this._dfa = null;\n        this.mergeCache = null; // wack cache after each prediction\n        input.seek(index);\n        input.release(m);\n    }\n};\n// Performs ATN simulation to compute a predicted alternative based\n//  upon the remaining input, but also updates the DFA cache to avoid\n//  having to traverse the ATN again for the same input sequence.\n\n// There are some key conditions we're looking for after computing a new\n// set of ATN configs (proposed DFA state):\n      // if the set is empty, there is no viable alternative for current symbol\n      // does the state uniquely predict an alternative?\n      // does the state have a conflict that would prevent us from\n      //   putting it on the work list?\n\n// We also have some key operations to do:\n      // add an edge from previous DFA state to potentially new DFA state, D,\n      //   upon current symbol but only if adding to work list, which means in all\n      //   cases except no viable alternative (and possibly non-greedy decisions?)\n      // collecting predicates and adding semantic context to DFA accept states\n      // adding rule context to context-sensitive DFA accept states\n      // consuming an input symbol\n      // reporting a conflict\n      // reporting an ambiguity\n      // reporting a context sensitivity\n      // reporting insufficient predicates\n\n// cover these cases:\n//    dead end\n//    single alt\n//    single alt + preds\n//    conflict\n//    conflict + preds\n//\nParserATNSimulator.prototype.execATN = function(dfa, s0, input, startIndex, outerContext ) {\n    if (this.debug || this.debug_list_atn_decisions) {\n        console.log(\"execATN decision \" + dfa.decision +\n                \" exec LA(1)==\" + this.getLookaheadName(input) +\n                \" line \" + input.LT(1).line + \":\" + input.LT(1).column);\n    }\n    var alt;\n    var previousD = s0;\n\n    if (this.debug) {\n        console.log(\"s0 = \" + s0);\n    }\n    var t = input.LA(1);\n    while(true) { // while more work\n        var D = this.getExistingTargetState(previousD, t);\n        if(D===null) {\n            D = this.computeTargetState(dfa, previousD, t);\n        }\n        if(D===ATNSimulator.ERROR) {\n            // if any configs in previous dipped into outer context, that\n            // means that input up to t actually finished entry rule\n            // at least for SLL decision. Full LL doesn't dip into outer\n            // so don't need special case.\n            // We will get an error no matter what so delay until after\n            // decision; better error message. Also, no reachable target\n            // ATN states in SLL implies LL will also get nowhere.\n            // If conflict in states that dip out, choose min since we\n            // will get error no matter what.\n            var e = this.noViableAlt(input, outerContext, previousD.configs, startIndex);\n            input.seek(startIndex);\n            alt = this.getSynValidOrSemInvalidAltThatFinishedDecisionEntryRule(previousD.configs, outerContext);\n            if(alt!==ATN.INVALID_ALT_NUMBER) {\n                return alt;\n            } else {\n                throw e;\n            }\n        }\n        if(D.requiresFullContext && this.predictionMode !== PredictionMode.SLL) {\n            // IF PREDS, MIGHT RESOLVE TO SINGLE ALT => SLL (or syntax error)\n            var conflictingAlts = null;\n            if (D.predicates!==null) {\n                if (this.debug) {\n                    console.log(\"DFA state has preds in DFA sim LL failover\");\n                }\n                var conflictIndex = input.index;\n                if(conflictIndex !== startIndex) {\n                    input.seek(startIndex);\n                }\n                conflictingAlts = this.evalSemanticContext(D.predicates, outerContext, true);\n                if (conflictingAlts.length===1) {\n                    if(this.debug) {\n                        console.log(\"Full LL avoided\");\n                    }\n                    return conflictingAlts.minValue();\n                }\n                if (conflictIndex !== startIndex) {\n                    // restore the index so reporting the fallback to full\n                    // context occurs with the index at the correct spot\n                    input.seek(conflictIndex);\n                }\n            }\n            if (this.dfa_debug) {\n                console.log(\"ctx sensitive state \" + outerContext +\" in \" + D);\n            }\n            var fullCtx = true;\n            var s0_closure = this.computeStartState(dfa.atnStartState, outerContext, fullCtx);\n            this.reportAttemptingFullContext(dfa, conflictingAlts, D.configs, startIndex, input.index);\n            alt = this.execATNWithFullContext(dfa, D, s0_closure, input, startIndex, outerContext);\n            return alt;\n        }\n        if (D.isAcceptState) {\n            if (D.predicates===null) {\n                return D.prediction;\n            }\n            var stopIndex = input.index;\n            input.seek(startIndex);\n            var alts = this.evalSemanticContext(D.predicates, outerContext, true);\n            if (alts.length===0) {\n                throw this.noViableAlt(input, outerContext, D.configs, startIndex);\n            } else if (alts.length===1) {\n                return alts.minValue();\n            } else {\n                // report ambiguity after predicate evaluation to make sure the correct set of ambig alts is reported.\n                this.reportAmbiguity(dfa, D, startIndex, stopIndex, false, alts, D.configs);\n                return alts.minValue();\n            }\n        }\n        previousD = D;\n\n        if (t !== Token.EOF) {\n            input.consume();\n            t = input.LA(1);\n        }\n    }\n};\n//\n// Get an existing target state for an edge in the DFA. If the target state\n// for the edge has not yet been computed or is otherwise not available,\n// this method returns {@code null}.\n//\n// @param previousD The current DFA state\n// @param t The next input symbol\n// @return The existing target DFA state for the given input symbol\n// {@code t}, or {@code null} if the target state for this edge is not\n// already cached\n//\nParserATNSimulator.prototype.getExistingTargetState = function(previousD, t) {\n    var edges = previousD.edges;\n    if (edges===null) {\n        return null;\n    } else {\n        return edges[t + 1] || null;\n    }\n};\n//\n// Compute a target state for an edge in the DFA, and attempt to add the\n// computed state and corresponding edge to the DFA.\n//\n// @param dfa The DFA\n// @param previousD The current DFA state\n// @param t The next input symbol\n//\n// @return The computed target DFA state for the given input symbol\n// {@code t}. If {@code t} does not lead to a valid DFA state, this method\n// returns {@link //ERROR}.\n//\nParserATNSimulator.prototype.computeTargetState = function(dfa, previousD, t) {\n   var reach = this.computeReachSet(previousD.configs, t, false);\n    if(reach===null) {\n        this.addDFAEdge(dfa, previousD, t, ATNSimulator.ERROR);\n        return ATNSimulator.ERROR;\n    }\n    // create new target state; we'll add to DFA after it's complete\n    var D = new DFAState(null, reach);\n\n    var predictedAlt = this.getUniqueAlt(reach);\n\n    if (this.debug) {\n        var altSubSets = PredictionMode.getConflictingAltSubsets(reach);\n        console.log(\"SLL altSubSets=\" + Utils.arrayToString(altSubSets) +\n                    \", previous=\" + previousD.configs +\n                    \", configs=\" + reach +\n                    \", predict=\" + predictedAlt +\n                    \", allSubsetsConflict=\" +\n                    PredictionMode.allSubsetsConflict(altSubSets) + \", conflictingAlts=\" +\n                    this.getConflictingAlts(reach));\n    }\n    if (predictedAlt!==ATN.INVALID_ALT_NUMBER) {\n        // NO CONFLICT, UNIQUELY PREDICTED ALT\n        D.isAcceptState = true;\n        D.configs.uniqueAlt = predictedAlt;\n        D.prediction = predictedAlt;\n    } else if (PredictionMode.hasSLLConflictTerminatingPrediction(this.predictionMode, reach)) {\n        // MORE THAN ONE VIABLE ALTERNATIVE\n        D.configs.conflictingAlts = this.getConflictingAlts(reach);\n        D.requiresFullContext = true;\n        // in SLL-only mode, we will stop at this state and return the minimum alt\n        D.isAcceptState = true;\n        D.prediction = D.configs.conflictingAlts.minValue();\n    }\n    if (D.isAcceptState && D.configs.hasSemanticContext) {\n        this.predicateDFAState(D, this.atn.getDecisionState(dfa.decision));\n        if( D.predicates!==null) {\n            D.prediction = ATN.INVALID_ALT_NUMBER;\n        }\n    }\n    // all adds to dfa are done after we've created full D state\n    D = this.addDFAEdge(dfa, previousD, t, D);\n    return D;\n};\n\nParserATNSimulator.prototype.predicateDFAState = function(dfaState, decisionState) {\n    // We need to test all predicates, even in DFA states that\n    // uniquely predict alternative.\n    var nalts = decisionState.transitions.length;\n    // Update DFA so reach becomes accept state with (predicate,alt)\n    // pairs if preds found for conflicting alts\n    var altsToCollectPredsFrom = this.getConflictingAltsOrUniqueAlt(dfaState.configs);\n    var altToPred = this.getPredsForAmbigAlts(altsToCollectPredsFrom, dfaState.configs, nalts);\n    if (altToPred!==null) {\n        dfaState.predicates = this.getPredicatePredictions(altsToCollectPredsFrom, altToPred);\n        dfaState.prediction = ATN.INVALID_ALT_NUMBER; // make sure we use preds\n    } else {\n        // There are preds in configs but they might go away\n        // when OR'd together like {p}? || NONE == NONE. If neither\n        // alt has preds, resolve to min alt\n        dfaState.prediction = altsToCollectPredsFrom.minValue();\n    }\n};\n\n// comes back with reach.uniqueAlt set to a valid alt\nParserATNSimulator.prototype.execATNWithFullContext = function(dfa, D, // how far we got before failing over\n                                     s0,\n                                     input,\n                                     startIndex,\n                                     outerContext) {\n    if (this.debug || this.debug_list_atn_decisions) {\n        console.log(\"execATNWithFullContext \"+s0);\n    }\n    var fullCtx = true;\n    var foundExactAmbig = false;\n    var reach = null;\n    var previous = s0;\n    input.seek(startIndex);\n    var t = input.LA(1);\n    var predictedAlt = -1;\n    while (true) { // while more work\n        reach = this.computeReachSet(previous, t, fullCtx);\n        if (reach===null) {\n            // if any configs in previous dipped into outer context, that\n            // means that input up to t actually finished entry rule\n            // at least for LL decision. Full LL doesn't dip into outer\n            // so don't need special case.\n            // We will get an error no matter what so delay until after\n            // decision; better error message. Also, no reachable target\n            // ATN states in SLL implies LL will also get nowhere.\n            // If conflict in states that dip out, choose min since we\n            // will get error no matter what.\n            var e = this.noViableAlt(input, outerContext, previous, startIndex);\n            input.seek(startIndex);\n            var alt = this.getSynValidOrSemInvalidAltThatFinishedDecisionEntryRule(previous, outerContext);\n            if(alt!==ATN.INVALID_ALT_NUMBER) {\n                return alt;\n            } else {\n                throw e;\n            }\n        }\n        var altSubSets = PredictionMode.getConflictingAltSubsets(reach);\n        if(this.debug) {\n            console.log(\"LL altSubSets=\" + altSubSets + \", predict=\" +\n                  PredictionMode.getUniqueAlt(altSubSets) + \", resolvesToJustOneViableAlt=\" +\n                  PredictionMode.resolvesToJustOneViableAlt(altSubSets));\n        }\n        reach.uniqueAlt = this.getUniqueAlt(reach);\n        // unique prediction?\n        if(reach.uniqueAlt!==ATN.INVALID_ALT_NUMBER) {\n            predictedAlt = reach.uniqueAlt;\n            break;\n        } else if (this.predictionMode !== PredictionMode.LL_EXACT_AMBIG_DETECTION) {\n            predictedAlt = PredictionMode.resolvesToJustOneViableAlt(altSubSets);\n            if(predictedAlt !== ATN.INVALID_ALT_NUMBER) {\n                break;\n            }\n        } else {\n            // In exact ambiguity mode, we never try to terminate early.\n            // Just keeps scarfing until we know what the conflict is\n            if (PredictionMode.allSubsetsConflict(altSubSets) && PredictionMode.allSubsetsEqual(altSubSets)) {\n                foundExactAmbig = true;\n                predictedAlt = PredictionMode.getSingleViableAlt(altSubSets);\n                break;\n            }\n            // else there are multiple non-conflicting subsets or\n            // we're not sure what the ambiguity is yet.\n            // So, keep going.\n        }\n        previous = reach;\n        if( t !== Token.EOF) {\n            input.consume();\n            t = input.LA(1);\n        }\n    }\n    // If the configuration set uniquely predicts an alternative,\n    // without conflict, then we know that it's a full LL decision\n    // not SLL.\n    if (reach.uniqueAlt !== ATN.INVALID_ALT_NUMBER ) {\n        this.reportContextSensitivity(dfa, predictedAlt, reach, startIndex, input.index);\n        return predictedAlt;\n    }\n    // We do not check predicates here because we have checked them\n    // on-the-fly when doing full context prediction.\n\n    //\n    // In non-exact ambiguity detection mode, we might\tactually be able to\n    // detect an exact ambiguity, but I'm not going to spend the cycles\n    // needed to check. We only emit ambiguity warnings in exact ambiguity\n    // mode.\n    //\n    // For example, we might know that we have conflicting configurations.\n    // But, that does not mean that there is no way forward without a\n    // conflict. It's possible to have nonconflicting alt subsets as in:\n\n    // altSubSets=[{1, 2}, {1, 2}, {1}, {1, 2}]\n\n    // from\n    //\n    //    [(17,1,[5 $]), (13,1,[5 10 $]), (21,1,[5 10 $]), (11,1,[$]),\n    //     (13,2,[5 10 $]), (21,2,[5 10 $]), (11,2,[$])]\n    //\n    // In this case, (17,1,[5 $]) indicates there is some next sequence that\n    // would resolve this without conflict to alternative 1. Any other viable\n    // next sequence, however, is associated with a conflict.  We stop\n    // looking for input because no amount of further lookahead will alter\n    // the fact that we should predict alternative 1.  We just can't say for\n    // sure that there is an ambiguity without looking further.\n\n    this.reportAmbiguity(dfa, D, startIndex, input.index, foundExactAmbig, null, reach);\n\n    return predictedAlt;\n};\n\nParserATNSimulator.prototype.computeReachSet = function(closure, t, fullCtx) {\n    if (this.debug) {\n        console.log(\"in computeReachSet, starting closure: \" + closure);\n    }\n    if( this.mergeCache===null) {\n        this.mergeCache = new DoubleDict();\n    }\n    var intermediate = new ATNConfigSet(fullCtx);\n\n    // Configurations already in a rule stop state indicate reaching the end\n    // of the decision rule (local context) or end of the start rule (full\n    // context). Once reached, these configurations are never updated by a\n    // closure operation, so they are handled separately for the performance\n    // advantage of having a smaller intermediate set when calling closure.\n    //\n    // For full-context reach operations, separate handling is required to\n    // ensure that the alternative matching the longest overall sequence is\n    // chosen when multiple such configurations can match the input.\n\n    var skippedStopStates = null;\n\n    // First figure out where we can reach on input t\n    for (var i=0; i<closure.items.length;i++) {\n        var c = closure.items[i];\n        if(this.debug_add) {\n            console.log(\"testing \" + this.getTokenName(t) + \" at \" + c);\n        }\n        if (c.state instanceof RuleStopState) {\n            if (fullCtx || t === Token.EOF) {\n                if (skippedStopStates===null) {\n                    skippedStopStates = [];\n                }\n                skippedStopStates.push(c);\n                if(this.debug_add) {\n                    console.log(\"added \" + c + \" to skippedStopStates\");\n                }\n            }\n            continue;\n        }\n        for(var j=0;j<c.state.transitions.length;j++) {\n            var trans = c.state.transitions[j];\n            var target = this.getReachableTarget(trans, t);\n            if (target!==null) {\n                var cfg = new ATNConfig({state:target}, c);\n                intermediate.add(cfg, this.mergeCache);\n                if(this.debug_add) {\n                    console.log(\"added \" + cfg + \" to intermediate\");\n                }\n            }\n        }\n    }\n    // Now figure out where the reach operation can take us...\n    var reach = null;\n\n    // This block optimizes the reach operation for intermediate sets which\n    // trivially indicate a termination state for the overall\n    // adaptivePredict operation.\n    //\n    // The conditions assume that intermediate\n    // contains all configurations relevant to the reach set, but this\n    // condition is not true when one or more configurations have been\n    // withheld in skippedStopStates, or when the current symbol is EOF.\n    //\n    if (skippedStopStates===null && t!==Token.EOF) {\n        if (intermediate.items.length===1) {\n            // Don't pursue the closure if there is just one state.\n            // It can only have one alternative; just add to result\n            // Also don't pursue the closure if there is unique alternative\n            // among the configurations.\n            reach = intermediate;\n        } else if (this.getUniqueAlt(intermediate)!==ATN.INVALID_ALT_NUMBER) {\n            // Also don't pursue the closure if there is unique alternative\n            // among the configurations.\n            reach = intermediate;\n        }\n    }\n    // If the reach set could not be trivially determined, perform a closure\n    // operation on the intermediate set to compute its initial value.\n    //\n    if (reach===null) {\n        reach = new ATNConfigSet(fullCtx);\n        var closureBusy = new Set();\n        var treatEofAsEpsilon = t === Token.EOF;\n        for (var k=0; k<intermediate.items.length;k++) {\n            this.closure(intermediate.items[k], reach, closureBusy, false, fullCtx, treatEofAsEpsilon);\n        }\n    }\n    if (t === Token.EOF) {\n        // After consuming EOF no additional input is possible, so we are\n        // only interested in configurations which reached the end of the\n        // decision rule (local context) or end of the start rule (full\n        // context). Update reach to contain only these configurations. This\n        // handles both explicit EOF transitions in the grammar and implicit\n        // EOF transitions following the end of the decision or start rule.\n        //\n        // When reach==intermediate, no closure operation was performed. In\n        // this case, removeAllConfigsNotInRuleStopState needs to check for\n        // reachable rule stop states as well as configurations already in\n        // a rule stop state.\n        //\n        // This is handled before the configurations in skippedStopStates,\n        // because any configurations potentially added from that list are\n        // already guaranteed to meet this condition whether or not it's\n        // required.\n        //\n        reach = this.removeAllConfigsNotInRuleStopState(reach, reach === intermediate);\n    }\n    // If skippedStopStates!==null, then it contains at least one\n    // configuration. For full-context reach operations, these\n    // configurations reached the end of the start rule, in which case we\n    // only add them back to reach if no configuration during the current\n    // closure operation reached such a state. This ensures adaptivePredict\n    // chooses an alternative matching the longest overall sequence when\n    // multiple alternatives are viable.\n    //\n    if (skippedStopStates!==null && ( (! fullCtx) || (! PredictionMode.hasConfigInRuleStopState(reach)))) {\n        for (var l=0; l<skippedStopStates.length;l++) {\n            reach.add(skippedStopStates[l], this.mergeCache);\n        }\n    }\n    if (reach.items.length===0) {\n        return null;\n    } else {\n        return reach;\n    }\n};\n//\n// Return a configuration set containing only the configurations from\n// {@code configs} which are in a {@link RuleStopState}. If all\n// configurations in {@code configs} are already in a rule stop state, this\n// method simply returns {@code configs}.\n//\n// <p>When {@code lookToEndOfRule} is true, this method uses\n// {@link ATN//nextTokens} for each configuration in {@code configs} which is\n// not already in a rule stop state to see if a rule stop state is reachable\n// from the configuration via epsilon-only transitions.</p>\n//\n// @param configs the configuration set to update\n// @param lookToEndOfRule when true, this method checks for rule stop states\n// reachable by epsilon-only transitions from each configuration in\n// {@code configs}.\n//\n// @return {@code configs} if all configurations in {@code configs} are in a\n// rule stop state, otherwise return a new configuration set containing only\n// the configurations from {@code configs} which are in a rule stop state\n//\nParserATNSimulator.prototype.removeAllConfigsNotInRuleStopState = function(configs, lookToEndOfRule) {\n    if (PredictionMode.allConfigsInRuleStopStates(configs)) {\n        return configs;\n    }\n    var result = new ATNConfigSet(configs.fullCtx);\n    for(var i=0; i<configs.items.length;i++) {\n        var config = configs.items[i];\n        if (config.state instanceof RuleStopState) {\n            result.add(config, this.mergeCache);\n            continue;\n        }\n        if (lookToEndOfRule && config.state.epsilonOnlyTransitions) {\n            var nextTokens = this.atn.nextTokens(config.state);\n            if (nextTokens.contains(Token.EPSILON)) {\n                var endOfRuleState = this.atn.ruleToStopState[config.state.ruleIndex];\n                result.add(new ATNConfig({state:endOfRuleState}, config), this.mergeCache);\n            }\n        }\n    }\n    return result;\n};\n\nParserATNSimulator.prototype.computeStartState = function(p, ctx, fullCtx) {\n    // always at least the implicit call to start rule\n    var initialContext = predictionContextFromRuleContext(this.atn, ctx);\n    var configs = new ATNConfigSet(fullCtx);\n    for(var i=0;i<p.transitions.length;i++) {\n        var target = p.transitions[i].target;\n        var c = new ATNConfig({ state:target, alt:i+1, context:initialContext }, null);\n        var closureBusy = new Set();\n        this.closure(c, configs, closureBusy, true, fullCtx, false);\n    }\n    return configs;\n};\n\n//\n// This method transforms the start state computed by\n// {@link //computeStartState} to the special start state used by a\n// precedence DFA for a particular precedence value. The transformation\n// process applies the following changes to the start state's configuration\n// set.\n//\n// <ol>\n// <li>Evaluate the precedence predicates for each configuration using\n// {@link SemanticContext//evalPrecedence}.</li>\n// <li>Remove all configurations which predict an alternative greater than\n// 1, for which another configuration that predicts alternative 1 is in the\n// same ATN state with the same prediction context. This transformation is\n// valid for the following reasons:\n// <ul>\n// <li>The closure block cannot contain any epsilon transitions which bypass\n// the body of the closure, so all states reachable via alternative 1 are\n// part of the precedence alternatives of the transformed left-recursive\n// rule.</li>\n// <li>The \"primary\" portion of a left recursive rule cannot contain an\n// epsilon transition, so the only way an alternative other than 1 can exist\n// in a state that is also reachable via alternative 1 is by nesting calls\n// to the left-recursive rule, with the outer calls not being at the\n// preferred precedence level.</li>\n// </ul>\n// </li>\n// </ol>\n//\n// <p>\n// The prediction context must be considered by this filter to address\n// situations like the following.\n// </p>\n// <code>\n// <pre>\n// grammar TA;\n// prog: statement* EOF;\n// statement: letterA | statement letterA 'b' ;\n// letterA: 'a';\n// </pre>\n// </code>\n// <p>\n// If the above grammar, the ATN state immediately before the token\n// reference {@code 'a'} in {@code letterA} is reachable from the left edge\n// of both the primary and closure blocks of the left-recursive rule\n// {@code statement}. The prediction context associated with each of these\n// configurations distinguishes between them, and prevents the alternative\n// which stepped out to {@code prog} (and then back in to {@code statement}\n// from being eliminated by the filter.\n// </p>\n//\n// @param configs The configuration set computed by\n// {@link //computeStartState} as the start state for the DFA.\n// @return The transformed configuration set representing the start state\n// for a precedence DFA at a particular precedence level (determined by\n// calling {@link Parser//getPrecedence}).\n//\nParserATNSimulator.prototype.applyPrecedenceFilter = function(configs) {\n\tvar config;\n\tvar statesFromAlt1 = [];\n    var configSet = new ATNConfigSet(configs.fullCtx);\n    for(var i=0; i<configs.items.length; i++) {\n        config = configs.items[i];\n        // handle alt 1 first\n        if (config.alt !== 1) {\n            continue;\n        }\n        var updatedContext = config.semanticContext.evalPrecedence(this.parser, this._outerContext);\n        if (updatedContext===null) {\n            // the configuration was eliminated\n            continue;\n        }\n        statesFromAlt1[config.state.stateNumber] = config.context;\n        if (updatedContext !== config.semanticContext) {\n            configSet.add(new ATNConfig({semanticContext:updatedContext}, config), this.mergeCache);\n        } else {\n            configSet.add(config, this.mergeCache);\n        }\n    }\n    for(i=0; i<configs.items.length; i++) {\n        config = configs.items[i];\n        if (config.alt === 1) {\n            // already handled\n            continue;\n        }\n        // In the future, this elimination step could be updated to also\n        // filter the prediction context for alternatives predicting alt>1\n        // (basically a graph subtraction algorithm).\n\t\tif (!config.precedenceFilterSuppressed) {\n            var context = statesFromAlt1[config.state.stateNumber] || null;\n            if (context!==null && context.equals(config.context)) {\n                // eliminated\n                continue;\n            }\n\t\t}\n        configSet.add(config, this.mergeCache);\n    }\n    return configSet;\n};\n\nParserATNSimulator.prototype.getReachableTarget = function(trans, ttype) {\n    if (trans.matches(ttype, 0, this.atn.maxTokenType)) {\n        return trans.target;\n    } else {\n        return null;\n    }\n};\n\nParserATNSimulator.prototype.getPredsForAmbigAlts = function(ambigAlts, configs, nalts) {\n    // REACH=[1|1|[]|0:0, 1|2|[]|0:1]\n    // altToPred starts as an array of all null contexts. The entry at index i\n    // corresponds to alternative i. altToPred[i] may have one of three values:\n    //   1. null: no ATNConfig c is found such that c.alt==i\n    //   2. SemanticContext.NONE: At least one ATNConfig c exists such that\n    //      c.alt==i and c.semanticContext==SemanticContext.NONE. In other words,\n    //      alt i has at least one unpredicated config.\n    //   3. Non-NONE Semantic Context: There exists at least one, and for all\n    //      ATNConfig c such that c.alt==i, c.semanticContext!=SemanticContext.NONE.\n    //\n    // From this, it is clear that NONE||anything==NONE.\n    //\n    var altToPred = [];\n    for(var i=0;i<configs.items.length;i++) {\n        var c = configs.items[i];\n        if(ambigAlts.contains( c.alt )) {\n            altToPred[c.alt] = SemanticContext.orContext(altToPred[c.alt] || null, c.semanticContext);\n        }\n    }\n    var nPredAlts = 0;\n    for (i =1;i< nalts+1;i++) {\n        var pred = altToPred[i] || null;\n        if (pred===null) {\n            altToPred[i] = SemanticContext.NONE;\n        } else if (pred !== SemanticContext.NONE) {\n            nPredAlts += 1;\n        }\n    }\n    // nonambig alts are null in altToPred\n    if (nPredAlts===0) {\n        altToPred = null;\n    }\n    if (this.debug) {\n        console.log(\"getPredsForAmbigAlts result \" + Utils.arrayToString(altToPred));\n    }\n    return altToPred;\n};\n\nParserATNSimulator.prototype.getPredicatePredictions = function(ambigAlts, altToPred) {\n    var pairs = [];\n    var containsPredicate = false;\n    for (var i=1; i<altToPred.length;i++) {\n        var pred = altToPred[i];\n        // unpredicated is indicated by SemanticContext.NONE\n        if( ambigAlts!==null && ambigAlts.contains( i )) {\n            pairs.push(new PredPrediction(pred, i));\n        }\n        if (pred !== SemanticContext.NONE) {\n            containsPredicate = true;\n        }\n    }\n    if (! containsPredicate) {\n        return null;\n    }\n    return pairs;\n};\n\n//\n// This method is used to improve the localization of error messages by\n// choosing an alternative rather than throwing a\n// {@link NoViableAltException} in particular prediction scenarios where the\n// {@link //ERROR} state was reached during ATN simulation.\n//\n// <p>\n// The default implementation of this method uses the following\n// algorithm to identify an ATN configuration which successfully parsed the\n// decision entry rule. Choosing such an alternative ensures that the\n// {@link ParserRuleContext} returned by the calling rule will be complete\n// and valid, and the syntax error will be reported later at a more\n// localized location.</p>\n//\n// <ul>\n// <li>If a syntactically valid path or paths reach the end of the decision rule and\n// they are semantically valid if predicated, return the min associated alt.</li>\n// <li>Else, if a semantically invalid but syntactically valid path exist\n// or paths exist, return the minimum associated alt.\n// </li>\n// <li>Otherwise, return {@link ATN//INVALID_ALT_NUMBER}.</li>\n// </ul>\n//\n// <p>\n// In some scenarios, the algorithm described above could predict an\n// alternative which will result in a {@link FailedPredicateException} in\n// the parser. Specifically, this could occur if the <em>only</em> configuration\n// capable of successfully parsing to the end of the decision rule is\n// blocked by a semantic predicate. By choosing this alternative within\n// {@link //adaptivePredict} instead of throwing a\n// {@link NoViableAltException}, the resulting\n// {@link FailedPredicateException} in the parser will identify the specific\n// predicate which is preventing the parser from successfully parsing the\n// decision rule, which helps developers identify and correct logic errors\n// in semantic predicates.\n// </p>\n//\n// @param configs The ATN configurations which were valid immediately before\n// the {@link //ERROR} state was reached\n// @param outerContext The is the \\gamma_0 initial parser context from the paper\n// or the parser stack at the instant before prediction commences.\n//\n// @return The value to return from {@link //adaptivePredict}, or\n// {@link ATN//INVALID_ALT_NUMBER} if a suitable alternative was not\n// identified and {@link //adaptivePredict} should report an error instead.\n//\nParserATNSimulator.prototype.getSynValidOrSemInvalidAltThatFinishedDecisionEntryRule = function(configs, outerContext) {\n    var cfgs = this.splitAccordingToSemanticValidity(configs, outerContext);\n    var semValidConfigs = cfgs[0];\n    var semInvalidConfigs = cfgs[1];\n    var alt = this.getAltThatFinishedDecisionEntryRule(semValidConfigs);\n    if (alt!==ATN.INVALID_ALT_NUMBER) { // semantically/syntactically viable path exists\n        return alt;\n    }\n    // Is there a syntactically valid path with a failed pred?\n    if (semInvalidConfigs.items.length>0) {\n        alt = this.getAltThatFinishedDecisionEntryRule(semInvalidConfigs);\n        if (alt!==ATN.INVALID_ALT_NUMBER) { // syntactically viable path exists\n            return alt;\n        }\n    }\n    return ATN.INVALID_ALT_NUMBER;\n};\n\nParserATNSimulator.prototype.getAltThatFinishedDecisionEntryRule = function(configs) {\n    var alts = [];\n    for(var i=0;i<configs.items.length; i++) {\n        var c = configs.items[i];\n        if (c.reachesIntoOuterContext>0 || ((c.state instanceof RuleStopState) && c.context.hasEmptyPath())) {\n            if(alts.indexOf(c.alt)<0) {\n                alts.push(c.alt);\n            }\n        }\n    }\n    if (alts.length===0) {\n        return ATN.INVALID_ALT_NUMBER;\n    } else {\n        return Math.min.apply(null, alts);\n    }\n};\n// Walk the list of configurations and split them according to\n//  those that have preds evaluating to true/false.  If no pred, assume\n//  true pred and include in succeeded set.  Returns Pair of sets.\n//\n//  Create a new set so as not to alter the incoming parameter.\n//\n//  Assumption: the input stream has been restored to the starting point\n//  prediction, which is where predicates need to evaluate.\n//\nParserATNSimulator.prototype.splitAccordingToSemanticValidity = function( configs, outerContext) {\n    var succeeded = new ATNConfigSet(configs.fullCtx);\n    var failed = new ATNConfigSet(configs.fullCtx);\n    for(var i=0;i<configs.items.length; i++) {\n        var c = configs.items[i];\n        if (c.semanticContext !== SemanticContext.NONE) {\n            var predicateEvaluationResult = c.semanticContext.evaluate(this.parser, outerContext);\n            if (predicateEvaluationResult) {\n                succeeded.add(c);\n            } else {\n                failed.add(c);\n            }\n        } else {\n            succeeded.add(c);\n        }\n    }\n    return [succeeded, failed];\n};\n\n// Look through a list of predicate/alt pairs, returning alts for the\n//  pairs that win. A {@code NONE} predicate indicates an alt containing an\n//  unpredicated config which behaves as \"always true.\" If !complete\n//  then we stop at the first predicate that evaluates to true. This\n//  includes pairs with null predicates.\n//\nParserATNSimulator.prototype.evalSemanticContext = function(predPredictions, outerContext, complete) {\n    var predictions = new BitSet();\n    for(var i=0;i<predPredictions.length;i++) {\n    \tvar pair = predPredictions[i];\n        if (pair.pred === SemanticContext.NONE) {\n            predictions.add(pair.alt);\n            if (! complete) {\n                break;\n            }\n            continue;\n        }\n        var predicateEvaluationResult = pair.pred.evaluate(this.parser, outerContext);\n        if (this.debug || this.dfa_debug) {\n            console.log(\"eval pred \" + pair + \"=\" + predicateEvaluationResult);\n        }\n        if (predicateEvaluationResult) {\n            if (this.debug || this.dfa_debug) {\n                console.log(\"PREDICT \" + pair.alt);\n            }\n            predictions.add(pair.alt);\n            if (! complete) {\n                break;\n            }\n        }\n    }\n    return predictions;\n};\n\n// TODO: If we are doing predicates, there is no point in pursuing\n//     closure operations if we reach a DFA state that uniquely predicts\n//     alternative. We will not be caching that DFA state and it is a\n//     waste to pursue the closure. Might have to advance when we do\n//     ambig detection thought :(\n//\n\nParserATNSimulator.prototype.closure = function(config, configs, closureBusy, collectPredicates, fullCtx, treatEofAsEpsilon) {\n    var initialDepth = 0;\n    this.closureCheckingStopState(config, configs, closureBusy, collectPredicates,\n                             fullCtx, initialDepth, treatEofAsEpsilon);\n};\n\n\nParserATNSimulator.prototype.closureCheckingStopState = function(config, configs, closureBusy, collectPredicates, fullCtx, depth, treatEofAsEpsilon) {\n    if (this.debug || this.debug_closure) {\n        console.log(\"closure(\" + config.toString(this.parser,true) + \")\");\n        // console.log(\"configs(\" + configs.toString() + \")\");\n        if(config.reachesIntoOuterContext>50) {\n            throw \"problem\";\n        }\n    }\n    if (config.state instanceof RuleStopState) {\n        // We hit rule end. If we have context info, use it\n        // run thru all possible stack tops in ctx\n        if (! config.context.isEmpty()) {\n            for ( var i =0; i<config.context.length; i++) {\n                if (config.context.getReturnState(i) === PredictionContext.EMPTY_RETURN_STATE) {\n                    if (fullCtx) {\n                        configs.add(new ATNConfig({state:config.state, context:PredictionContext.EMPTY}, config), this.mergeCache);\n                        continue;\n                    } else {\n                        // we have no context info, just chase follow links (if greedy)\n                        if (this.debug) {\n                            console.log(\"FALLING off rule \" + this.getRuleName(config.state.ruleIndex));\n                        }\n                        this.closure_(config, configs, closureBusy, collectPredicates,\n                                 fullCtx, depth, treatEofAsEpsilon);\n                    }\n                    continue;\n                }\n                var returnState = this.atn.states[config.context.getReturnState(i)];\n                var newContext = config.context.getParent(i); // \"pop\" return state\n                var parms = {state:returnState, alt:config.alt, context:newContext, semanticContext:config.semanticContext};\n                var c = new ATNConfig(parms, null);\n                // While we have context to pop back from, we may have\n                // gotten that context AFTER having falling off a rule.\n                // Make sure we track that we are now out of context.\n                c.reachesIntoOuterContext = config.reachesIntoOuterContext;\n                this.closureCheckingStopState(c, configs, closureBusy, collectPredicates, fullCtx, depth - 1, treatEofAsEpsilon);\n            }\n            return;\n        } else if( fullCtx) {\n            // reached end of start rule\n            configs.add(config, this.mergeCache);\n            return;\n        } else {\n            // else if we have no context info, just chase follow links (if greedy)\n            if (this.debug) {\n                console.log(\"FALLING off rule \" + this.getRuleName(config.state.ruleIndex));\n            }\n        }\n    }\n    this.closure_(config, configs, closureBusy, collectPredicates, fullCtx, depth, treatEofAsEpsilon);\n};\n\n\n// Do the actual work of walking epsilon edges//\nParserATNSimulator.prototype.closure_ = function(config, configs, closureBusy, collectPredicates, fullCtx, depth, treatEofAsEpsilon) {\n    var p = config.state;\n    // optimization\n    if (! p.epsilonOnlyTransitions) {\n        configs.add(config, this.mergeCache);\n        // make sure to not return here, because EOF transitions can act as\n        // both epsilon transitions and non-epsilon transitions.\n    }\n    for(var i = 0;i<p.transitions.length; i++) {\n        if(i==0 && this.canDropLoopEntryEdgeInLeftRecursiveRule(config))\n            continue;\n\n        var t = p.transitions[i];\n        var continueCollecting = collectPredicates && !(t instanceof ActionTransition);\n        var c = this.getEpsilonTarget(config, t, continueCollecting, depth === 0, fullCtx, treatEofAsEpsilon);\n        if (c!==null) {\n\t\t\tif (!t.isEpsilon && closureBusy.add(c)!==c){\n\t\t\t\t// avoid infinite recursion for EOF* and EOF+\n\t\t\t\tcontinue;\n\t\t\t}\n            var newDepth = depth;\n            if ( config.state instanceof RuleStopState) {\n                // target fell off end of rule; mark resulting c as having dipped into outer context\n                // We can't get here if incoming config was rule stop and we had context\n                // track how far we dip into outer context.  Might\n                // come in handy and we avoid evaluating context dependent\n                // preds if this is > 0.\n\n                if (closureBusy.add(c)!==c) {\n                    // avoid infinite recursion for right-recursive rules\n                    continue;\n                }\n\n\t\t\t\tif (this._dfa !== null && this._dfa.precedenceDfa) {\n\t\t\t\t\tif (t.outermostPrecedenceReturn === this._dfa.atnStartState.ruleIndex) {\n\t\t\t\t\t\tc.precedenceFilterSuppressed = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n                c.reachesIntoOuterContext += 1;\n                configs.dipsIntoOuterContext = true; // TODO: can remove? only care when we add to set per middle of this method\n                newDepth -= 1;\n                if (this.debug) {\n                    console.log(\"dips into outer ctx: \" + c);\n                }\n            } else if (t instanceof RuleTransition) {\n                // latch when newDepth goes negative - once we step out of the entry context we can't return\n                if (newDepth >= 0) {\n                    newDepth += 1;\n                }\n            }\n            this.closureCheckingStopState(c, configs, closureBusy, continueCollecting, fullCtx, newDepth, treatEofAsEpsilon);\n        }\n    }\n};\n\n\nParserATNSimulator.prototype.canDropLoopEntryEdgeInLeftRecursiveRule = function(config) {\n    // return False\n    var p = config.state;\n    // First check to see if we are in StarLoopEntryState generated during\n    // left-recursion elimination. For efficiency, also check if\n    // the context has an empty stack case. If so, it would mean\n    // global FOLLOW so we can't perform optimization\n    // Are we the special loop entry/exit state? or SLL wildcard\n    if(p.stateType != ATNState.STAR_LOOP_ENTRY)\n        return false;\n    if(p.stateType != ATNState.STAR_LOOP_ENTRY || !p.isPrecedenceDecision ||\n           config.context.isEmpty() || config.context.hasEmptyPath())\n        return false;\n\n    // Require all return states to return back to the same rule that p is in.\n    var numCtxs = config.context.length;\n    for(var i=0; i<numCtxs; i++) { // for each stack context\n        var returnState = this.atn.states[config.context.getReturnState(i)];\n        if (returnState.ruleIndex != p.ruleIndex)\n            return false;\n    }\n\n    var decisionStartState = p.transitions[0].target;\n    var blockEndStateNum = decisionStartState.endState.stateNumber;\n    var blockEndState = this.atn.states[blockEndStateNum];\n\n    // Verify that the top of each stack context leads to loop entry/exit\n    // state through epsilon edges and w/o leaving rule.\n    for(var i=0; i<numCtxs; i++) { // for each stack context\n        var returnStateNumber = config.context.getReturnState(i);\n        var returnState = this.atn.states[returnStateNumber];\n        // all states must have single outgoing epsilon edge\n        if (returnState.transitions.length != 1 || !returnState.transitions[0].isEpsilon)\n            return false;\n\n        // Look for prefix op case like 'not expr', (' type ')' expr\n        var returnStateTarget = returnState.transitions[0].target;\n        if ( returnState.stateType == ATNState.BLOCK_END && returnStateTarget == p )\n            continue;\n\n        // Look for 'expr op expr' or case where expr's return state is block end\n        // of (...)* internal block; the block end points to loop back\n        // which points to p but we don't need to check that\n        if ( returnState == blockEndState )\n            continue;\n\n        // Look for ternary expr ? expr : expr. The return state points at block end,\n        // which points at loop entry state\n        if ( returnStateTarget == blockEndState )\n            continue;\n\n        // Look for complex prefix 'between expr and expr' case where 2nd expr's\n        // return state points at block end state of (...)* internal block\n        if (returnStateTarget.stateType == ATNState.BLOCK_END && returnStateTarget.transitions.length == 1\n                && returnStateTarget.transitions[0].isEpsilon && returnStateTarget.transitions[0].target == p)\n            continue;\n\n        // anything else ain't conforming\n        return false;\n    }\n    return true;\n};\n\n\nParserATNSimulator.prototype.getRuleName = function( index) {\n    if (this.parser!==null && index>=0) {\n        return this.parser.ruleNames[index];\n    } else {\n        return \"<rule \" + index + \">\";\n    }\n};\n\nParserATNSimulator.prototype.getEpsilonTarget = function(config, t, collectPredicates, inContext, fullCtx, treatEofAsEpsilon) {\n    switch(t.serializationType) {\n    case Transition.RULE:\n        return this.ruleTransition(config, t);\n    case Transition.PRECEDENCE:\n        return this.precedenceTransition(config, t, collectPredicates, inContext, fullCtx);\n    case Transition.PREDICATE:\n        return this.predTransition(config, t, collectPredicates, inContext, fullCtx);\n    case Transition.ACTION:\n        return this.actionTransition(config, t);\n    case Transition.EPSILON:\n        return new ATNConfig({state:t.target}, config);\n    case Transition.ATOM:\n    case Transition.RANGE:\n    case Transition.SET:\n        // EOF transitions act like epsilon transitions after the first EOF\n        // transition is traversed\n        if (treatEofAsEpsilon) {\n            if (t.matches(Token.EOF, 0, 1)) {\n                return new ATNConfig({state: t.target}, config);\n            }\n        }\n        return null;\n    default:\n    \treturn null;\n    }\n};\n\nParserATNSimulator.prototype.actionTransition = function(config, t) {\n    if (this.debug) {\n        var index = t.actionIndex==-1 ? 65535 : t.actionIndex;\n        console.log(\"ACTION edge \" + t.ruleIndex + \":\" + index);\n    }\n    return new ATNConfig({state:t.target}, config);\n};\n\nParserATNSimulator.prototype.precedenceTransition = function(config, pt,  collectPredicates, inContext, fullCtx) {\n    if (this.debug) {\n        console.log(\"PRED (collectPredicates=\" + collectPredicates + \") \" +\n                pt.precedence + \">=_p, ctx dependent=true\");\n        if (this.parser!==null) {\n        \tconsole.log(\"context surrounding pred is \" + Utils.arrayToString(this.parser.getRuleInvocationStack()));\n        }\n    }\n    var c = null;\n    if (collectPredicates && inContext) {\n        if (fullCtx) {\n            // In full context mode, we can evaluate predicates on-the-fly\n            // during closure, which dramatically reduces the size of\n            // the config sets. It also obviates the need to test predicates\n            // later during conflict resolution.\n            var currentPosition = this._input.index;\n            this._input.seek(this._startIndex);\n            var predSucceeds = pt.getPredicate().evaluate(this.parser, this._outerContext);\n            this._input.seek(currentPosition);\n            if (predSucceeds) {\n                c = new ATNConfig({state:pt.target}, config); // no pred context\n            }\n        } else {\n            var newSemCtx = SemanticContext.andContext(config.semanticContext, pt.getPredicate());\n            c = new ATNConfig({state:pt.target, semanticContext:newSemCtx}, config);\n        }\n    } else {\n        c = new ATNConfig({state:pt.target}, config);\n    }\n    if (this.debug) {\n        console.log(\"config from pred transition=\" + c);\n    }\n    return c;\n};\n\nParserATNSimulator.prototype.predTransition = function(config, pt, collectPredicates, inContext, fullCtx) {\n    if (this.debug) {\n        console.log(\"PRED (collectPredicates=\" + collectPredicates + \") \" + pt.ruleIndex +\n                \":\" + pt.predIndex + \", ctx dependent=\" + pt.isCtxDependent);\n        if (this.parser!==null) {\n            console.log(\"context surrounding pred is \" + Utils.arrayToString(this.parser.getRuleInvocationStack()));\n        }\n    }\n    var c = null;\n    if (collectPredicates && ((pt.isCtxDependent && inContext) || ! pt.isCtxDependent)) {\n        if (fullCtx) {\n            // In full context mode, we can evaluate predicates on-the-fly\n            // during closure, which dramatically reduces the size of\n            // the config sets. It also obviates the need to test predicates\n            // later during conflict resolution.\n            var currentPosition = this._input.index;\n            this._input.seek(this._startIndex);\n            var predSucceeds = pt.getPredicate().evaluate(this.parser, this._outerContext);\n            this._input.seek(currentPosition);\n            if (predSucceeds) {\n                c = new ATNConfig({state:pt.target}, config); // no pred context\n            }\n        } else {\n            var newSemCtx = SemanticContext.andContext(config.semanticContext, pt.getPredicate());\n            c = new ATNConfig({state:pt.target, semanticContext:newSemCtx}, config);\n        }\n    } else {\n        c = new ATNConfig({state:pt.target}, config);\n    }\n    if (this.debug) {\n        console.log(\"config from pred transition=\" + c);\n    }\n    return c;\n};\n\nParserATNSimulator.prototype.ruleTransition = function(config, t) {\n    if (this.debug) {\n        console.log(\"CALL rule \" + this.getRuleName(t.target.ruleIndex) + \", ctx=\" + config.context);\n    }\n    var returnState = t.followState;\n    var newContext = SingletonPredictionContext.create(config.context, returnState.stateNumber);\n    return new ATNConfig({state:t.target, context:newContext}, config );\n};\n\nParserATNSimulator.prototype.getConflictingAlts = function(configs) {\n    var altsets = PredictionMode.getConflictingAltSubsets(configs);\n    return PredictionMode.getAlts(altsets);\n};\n\n // Sam pointed out a problem with the previous definition, v3, of\n // ambiguous states. If we have another state associated with conflicting\n // alternatives, we should keep going. For example, the following grammar\n //\n // s : (ID | ID ID?) ';' ;\n //\n // When the ATN simulation reaches the state before ';', it has a DFA\n // state that looks like: [12|1|[], 6|2|[], 12|2|[]]. Naturally\n // 12|1|[] and 12|2|[] conflict, but we cannot stop processing this node\n // because alternative to has another way to continue, via [6|2|[]].\n // The key is that we have a single state that has config's only associated\n // with a single alternative, 2, and crucially the state transitions\n // among the configurations are all non-epsilon transitions. That means\n // we don't consider any conflicts that include alternative 2. So, we\n // ignore the conflict between alts 1 and 2. We ignore a set of\n // conflicting alts when there is an intersection with an alternative\n // associated with a single alt state in the state&rarr;config-list map.\n //\n // It's also the case that we might have two conflicting configurations but\n // also a 3rd nonconflicting configuration for a different alternative:\n // [1|1|[], 1|2|[], 8|3|[]]. This can come about from grammar:\n //\n // a : A | A | A B ;\n //\n // After matching input A, we reach the stop state for rule A, state 1.\n // State 8 is the state right before B. Clearly alternatives 1 and 2\n // conflict and no amount of further lookahead will separate the two.\n // However, alternative 3 will be able to continue and so we do not\n // stop working on this state. In the previous example, we're concerned\n // with states associated with the conflicting alternatives. Here alt\n // 3 is not associated with the conflicting configs, but since we can continue\n // looking for input reasonably, I don't declare the state done. We\n // ignore a set of conflicting alts when we have an alternative\n // that we still need to pursue.\n//\n\nParserATNSimulator.prototype.getConflictingAltsOrUniqueAlt = function(configs) {\n    var conflictingAlts = null;\n    if (configs.uniqueAlt!== ATN.INVALID_ALT_NUMBER) {\n        conflictingAlts = new BitSet();\n        conflictingAlts.add(configs.uniqueAlt);\n    } else {\n        conflictingAlts = configs.conflictingAlts;\n    }\n    return conflictingAlts;\n};\n\nParserATNSimulator.prototype.getTokenName = function( t) {\n    if (t===Token.EOF) {\n        return \"EOF\";\n    }\n    if( this.parser!==null && this.parser.literalNames!==null) {\n        if (t >= this.parser.literalNames.length && t >= this.parser.symbolicNames.length) {\n            console.log(\"\" + t + \" ttype out of range: \" + this.parser.literalNames);\n            console.log(\"\" + this.parser.getInputStream().getTokens());\n        } else {\n            var name = this.parser.literalNames[t] || this.parser.symbolicNames[t];\n            return name + \"<\" + t + \">\";\n        }\n    }\n    return \"\" + t;\n};\n\nParserATNSimulator.prototype.getLookaheadName = function(input) {\n    return this.getTokenName(input.LA(1));\n};\n\n// Used for debugging in adaptivePredict around execATN but I cut\n//  it out for clarity now that alg. works well. We can leave this\n//  \"dead\" code for a bit.\n//\nParserATNSimulator.prototype.dumpDeadEndConfigs = function(nvae) {\n    console.log(\"dead end configs: \");\n    var decs = nvae.getDeadEndConfigs();\n    for(var i=0; i<decs.length; i++) {\n    \tvar c = decs[i];\n        var trans = \"no edges\";\n        if (c.state.transitions.length>0) {\n            var t = c.state.transitions[0];\n            if (t instanceof AtomTransition) {\n                trans = \"Atom \"+ this.getTokenName(t.label);\n            } else if (t instanceof SetTransition) {\n                var neg = (t instanceof NotSetTransition);\n                trans = (neg ? \"~\" : \"\") + \"Set \" + t.set;\n            }\n        }\n        console.error(c.toString(this.parser, true) + \":\" + trans);\n    }\n};\n\nParserATNSimulator.prototype.noViableAlt = function(input, outerContext, configs, startIndex) {\n    return new NoViableAltException(this.parser, input, input.get(startIndex), input.LT(1), configs, outerContext);\n};\n\nParserATNSimulator.prototype.getUniqueAlt = function(configs) {\n    var alt = ATN.INVALID_ALT_NUMBER;\n    for(var i=0;i<configs.items.length;i++) {\n    \tvar c = configs.items[i];\n        if (alt === ATN.INVALID_ALT_NUMBER) {\n            alt = c.alt // found first alt\n        } else if( c.alt!==alt) {\n            return ATN.INVALID_ALT_NUMBER;\n        }\n    }\n    return alt;\n};\n\n//\n// Add an edge to the DFA, if possible. This method calls\n// {@link //addDFAState} to ensure the {@code to} state is present in the\n// DFA. If {@code from} is {@code null}, or if {@code t} is outside the\n// range of edges that can be represented in the DFA tables, this method\n// returns without adding the edge to the DFA.\n//\n// <p>If {@code to} is {@code null}, this method returns {@code null}.\n// Otherwise, this method returns the {@link DFAState} returned by calling\n// {@link //addDFAState} for the {@code to} state.</p>\n//\n// @param dfa The DFA\n// @param from The source state for the edge\n// @param t The input symbol\n// @param to The target state for the edge\n//\n// @return If {@code to} is {@code null}, this method returns {@code null};\n// otherwise this method returns the result of calling {@link //addDFAState}\n// on {@code to}\n//\nParserATNSimulator.prototype.addDFAEdge = function(dfa, from_, t, to) {\n    if( this.debug) {\n        console.log(\"EDGE \" + from_ + \" -> \" + to + \" upon \" + this.getTokenName(t));\n    }\n    if (to===null) {\n        return null;\n    }\n    to = this.addDFAState(dfa, to); // used existing if possible not incoming\n    if (from_===null || t < -1 || t > this.atn.maxTokenType) {\n        return to;\n    }\n    if (from_.edges===null) {\n        from_.edges = [];\n    }\n    from_.edges[t+1] = to; // connect\n\n    if (this.debug) {\n        var literalNames = this.parser===null ? null : this.parser.literalNames;\n        var symbolicNames = this.parser===null ? null : this.parser.symbolicNames;\n        console.log(\"DFA=\\n\" + dfa.toString(literalNames, symbolicNames));\n    }\n    return to;\n};\n//\n// Add state {@code D} to the DFA if it is not already present, and return\n// the actual instance stored in the DFA. If a state equivalent to {@code D}\n// is already in the DFA, the existing state is returned. Otherwise this\n// method returns {@code D} after adding it to the DFA.\n//\n// <p>If {@code D} is {@link //ERROR}, this method returns {@link //ERROR} and\n// does not change the DFA.</p>\n//\n// @param dfa The dfa\n// @param D The DFA state to add\n// @return The state stored in the DFA. This will be either the existing\n// state if {@code D} is already in the DFA, or {@code D} itself if the\n// state was not already present.\n//\nParserATNSimulator.prototype.addDFAState = function(dfa, D) {\n    if (D == ATNSimulator.ERROR) {\n        return D;\n    }\n    var existing = dfa.states.get(D);\n    if(existing!==null) {\n        return existing;\n    }\n    D.stateNumber = dfa.states.length;\n    if (! D.configs.readOnly) {\n        D.configs.optimizeConfigs(this);\n        D.configs.setReadonly(true);\n    }\n    dfa.states.add(D);\n    if (this.debug) {\n        console.log(\"adding new DFA state: \" + D);\n    }\n    return D;\n};\n\nParserATNSimulator.prototype.reportAttemptingFullContext = function(dfa, conflictingAlts, configs, startIndex, stopIndex) {\n    if (this.debug || this.retry_debug) {\n        var interval = new Interval(startIndex, stopIndex + 1);\n        console.log(\"reportAttemptingFullContext decision=\" + dfa.decision + \":\" + configs +\n                           \", input=\" + this.parser.getTokenStream().getText(interval));\n    }\n    if (this.parser!==null) {\n        this.parser.getErrorListenerDispatch().reportAttemptingFullContext(this.parser, dfa, startIndex, stopIndex, conflictingAlts, configs);\n    }\n};\n\nParserATNSimulator.prototype.reportContextSensitivity = function(dfa, prediction, configs, startIndex, stopIndex) {\n    if (this.debug || this.retry_debug) {\n        var interval = new Interval(startIndex, stopIndex + 1);\n        console.log(\"reportContextSensitivity decision=\" + dfa.decision + \":\" + configs +\n                           \", input=\" + this.parser.getTokenStream().getText(interval));\n    }\n    if (this.parser!==null) {\n        this.parser.getErrorListenerDispatch().reportContextSensitivity(this.parser, dfa, startIndex, stopIndex, prediction, configs);\n    }\n};\n\n// If context sensitive parsing, we know it's ambiguity not conflict//\nParserATNSimulator.prototype.reportAmbiguity = function(dfa, D, startIndex, stopIndex,\n                               exact, ambigAlts, configs ) {\n    if (this.debug || this.retry_debug) {\n        var interval = new Interval(startIndex, stopIndex + 1);\n        console.log(\"reportAmbiguity \" + ambigAlts + \":\" + configs +\n                           \", input=\" + this.parser.getTokenStream().getText(interval));\n    }\n    if (this.parser!==null) {\n        this.parser.getErrorListenerDispatch().reportAmbiguity(this.parser, dfa, startIndex, stopIndex, exact, ambigAlts, configs);\n    }\n};\n\nexports.ParserATNSimulator = ParserATNSimulator;","//\n/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n//\n//\n// This enumeration defines the prediction modes available in ANTLR 4 along with\n// utility methods for analyzing configuration sets for conflicts and/or\n// ambiguities.\n\nvar Set = require('./../Utils').Set;\nvar Map = require('./../Utils').Map;\nvar BitSet = require('./../Utils').BitSet;\nvar AltDict = require('./../Utils').AltDict;\nvar ATN = require('./ATN').ATN;\nvar RuleStopState = require('./ATNState').RuleStopState;\nvar ATNConfigSet = require('./ATNConfigSet').ATNConfigSet;\nvar ATNConfig = require('./ATNConfig').ATNConfig;\nvar SemanticContext = require('./SemanticContext').SemanticContext;\nvar Hash = require(\"../Utils\").Hash;\nvar hashStuff = require('./../Utils').hashStuff;\nvar equalArrays = require('./../Utils').equalArrays;\n\nfunction PredictionMode() {\n\treturn this;\n}\n\n//\n// The SLL(*) prediction mode. This prediction mode ignores the current\n// parser context when making predictions. This is the fastest prediction\n// mode, and provides correct results for many grammars. This prediction\n// mode is more powerful than the prediction mode provided by ANTLR 3, but\n// may result in syntax errors for grammar and input combinations which are\n// not SLL.\n//\n// <p>\n// When using this prediction mode, the parser will either return a correct\n// parse tree (i.e. the same parse tree that would be returned with the\n// {@link //LL} prediction mode), or it will report a syntax error. If a\n// syntax error is encountered when using the {@link //SLL} prediction mode,\n// it may be due to either an actual syntax error in the input or indicate\n// that the particular combination of grammar and input requires the more\n// powerful {@link //LL} prediction abilities to complete successfully.</p>\n//\n// <p>\n// This prediction mode does not provide any guarantees for prediction\n// behavior for syntactically-incorrect inputs.</p>\n//\nPredictionMode.SLL = 0;\n//\n// The LL(*) prediction mode. This prediction mode allows the current parser\n// context to be used for resolving SLL conflicts that occur during\n// prediction. This is the fastest prediction mode that guarantees correct\n// parse results for all combinations of grammars with syntactically correct\n// inputs.\n//\n// <p>\n// When using this prediction mode, the parser will make correct decisions\n// for all syntactically-correct grammar and input combinations. However, in\n// cases where the grammar is truly ambiguous this prediction mode might not\n// report a precise answer for <em>exactly which</em> alternatives are\n// ambiguous.</p>\n//\n// <p>\n// This prediction mode does not provide any guarantees for prediction\n// behavior for syntactically-incorrect inputs.</p>\n//\nPredictionMode.LL = 1;\n//\n// The LL(*) prediction mode with exact ambiguity detection. In addition to\n// the correctness guarantees provided by the {@link //LL} prediction mode,\n// this prediction mode instructs the prediction algorithm to determine the\n// complete and exact set of ambiguous alternatives for every ambiguous\n// decision encountered while parsing.\n//\n// <p>\n// This prediction mode may be used for diagnosing ambiguities during\n// grammar development. Due to the performance overhead of calculating sets\n// of ambiguous alternatives, this prediction mode should be avoided when\n// the exact results are not necessary.</p>\n//\n// <p>\n// This prediction mode does not provide any guarantees for prediction\n// behavior for syntactically-incorrect inputs.</p>\n//\nPredictionMode.LL_EXACT_AMBIG_DETECTION = 2;\n\n\n//\n// Computes the SLL prediction termination condition.\n//\n// <p>\n// This method computes the SLL prediction termination condition for both of\n// the following cases.</p>\n//\n// <ul>\n// <li>The usual SLL+LL fallback upon SLL conflict</li>\n// <li>Pure SLL without LL fallback</li>\n// </ul>\n//\n// <p><strong>COMBINED SLL+LL PARSING</strong></p>\n//\n// <p>When LL-fallback is enabled upon SLL conflict, correct predictions are\n// ensured regardless of how the termination condition is computed by this\n// method. Due to the substantially higher cost of LL prediction, the\n// prediction should only fall back to LL when the additional lookahead\n// cannot lead to a unique SLL prediction.</p>\n//\n// <p>Assuming combined SLL+LL parsing, an SLL configuration set with only\n// conflicting subsets should fall back to full LL, even if the\n// configuration sets don't resolve to the same alternative (e.g.\n// {@code {1,2}} and {@code {3,4}}. If there is at least one non-conflicting\n// configuration, SLL could continue with the hopes that more lookahead will\n// resolve via one of those non-conflicting configurations.</p>\n//\n// <p>Here's the prediction termination rule them: SLL (for SLL+LL parsing)\n// stops when it sees only conflicting configuration subsets. In contrast,\n// full LL keeps going when there is uncertainty.</p>\n//\n// <p><strong>HEURISTIC</strong></p>\n//\n// <p>As a heuristic, we stop prediction when we see any conflicting subset\n// unless we see a state that only has one alternative associated with it.\n// The single-alt-state thing lets prediction continue upon rules like\n// (otherwise, it would admit defeat too soon):</p>\n//\n// <p>{@code [12|1|[], 6|2|[], 12|2|[]]. s : (ID | ID ID?) ';' ;}</p>\n//\n// <p>When the ATN simulation reaches the state before {@code ';'}, it has a\n// DFA state that looks like: {@code [12|1|[], 6|2|[], 12|2|[]]}. Naturally\n// {@code 12|1|[]} and {@code 12|2|[]} conflict, but we cannot stop\n// processing this node because alternative to has another way to continue,\n// via {@code [6|2|[]]}.</p>\n//\n// <p>It also let's us continue for this rule:</p>\n//\n// <p>{@code [1|1|[], 1|2|[], 8|3|[]] a : A | A | A B ;}</p>\n//\n// <p>After matching input A, we reach the stop state for rule A, state 1.\n// State 8 is the state right before B. Clearly alternatives 1 and 2\n// conflict and no amount of further lookahead will separate the two.\n// However, alternative 3 will be able to continue and so we do not stop\n// working on this state. In the previous example, we're concerned with\n// states associated with the conflicting alternatives. Here alt 3 is not\n// associated with the conflicting configs, but since we can continue\n// looking for input reasonably, don't declare the state done.</p>\n//\n// <p><strong>PURE SLL PARSING</strong></p>\n//\n// <p>To handle pure SLL parsing, all we have to do is make sure that we\n// combine stack contexts for configurations that differ only by semantic\n// predicate. From there, we can do the usual SLL termination heuristic.</p>\n//\n// <p><strong>PREDICATES IN SLL+LL PARSING</strong></p>\n//\n// <p>SLL decisions don't evaluate predicates until after they reach DFA stop\n// states because they need to create the DFA cache that works in all\n// semantic situations. In contrast, full LL evaluates predicates collected\n// during start state computation so it can ignore predicates thereafter.\n// This means that SLL termination detection can totally ignore semantic\n// predicates.</p>\n//\n// <p>Implementation-wise, {@link ATNConfigSet} combines stack contexts but not\n// semantic predicate contexts so we might see two configurations like the\n// following.</p>\n//\n// <p>{@code (s, 1, x, {}), (s, 1, x', {p})}</p>\n//\n// <p>Before testing these configurations against others, we have to merge\n// {@code x} and {@code x'} (without modifying the existing configurations).\n// For example, we test {@code (x+x')==x''} when looking for conflicts in\n// the following configurations.</p>\n//\n// <p>{@code (s, 1, x, {}), (s, 1, x', {p}), (s, 2, x'', {})}</p>\n//\n// <p>If the configuration set has predicates (as indicated by\n// {@link ATNConfigSet//hasSemanticContext}), this algorithm makes a copy of\n// the configurations to strip out all of the predicates so that a standard\n// {@link ATNConfigSet} will merge everything ignoring predicates.</p>\n//\nPredictionMode.hasSLLConflictTerminatingPrediction = function( mode, configs) {\n    // Configs in rule stop states indicate reaching the end of the decision\n    // rule (local context) or end of start rule (full context). If all\n    // configs meet this condition, then none of the configurations is able\n    // to match additional input so we terminate prediction.\n    //\n    if (PredictionMode.allConfigsInRuleStopStates(configs)) {\n        return true;\n    }\n    // pure SLL mode parsing\n    if (mode === PredictionMode.SLL) {\n        // Don't bother with combining configs from different semantic\n        // contexts if we can fail over to full LL; costs more time\n        // since we'll often fail over anyway.\n        if (configs.hasSemanticContext) {\n            // dup configs, tossing out semantic predicates\n            var dup = new ATNConfigSet();\n            for(var i=0;i<configs.items.length;i++) {\n            \tvar c = configs.items[i];\n                c = new ATNConfig({semanticContext:SemanticContext.NONE}, c);\n                dup.add(c);\n            }\n            configs = dup;\n        }\n        // now we have combined contexts for configs with dissimilar preds\n    }\n    // pure SLL or combined SLL+LL mode parsing\n    var altsets = PredictionMode.getConflictingAltSubsets(configs);\n    return PredictionMode.hasConflictingAltSet(altsets) && !PredictionMode.hasStateAssociatedWithOneAlt(configs);\n};\n\n// Checks if any configuration in {@code configs} is in a\n// {@link RuleStopState}. Configurations meeting this condition have reached\n// the end of the decision rule (local context) or end of start rule (full\n// context).\n//\n// @param configs the configuration set to test\n// @return {@code true} if any configuration in {@code configs} is in a\n// {@link RuleStopState}, otherwise {@code false}\nPredictionMode.hasConfigInRuleStopState = function(configs) {\n\tfor(var i=0;i<configs.items.length;i++) {\n\t\tvar c = configs.items[i];\n        if (c.state instanceof RuleStopState) {\n            return true;\n        }\n\t}\n    return false;\n};\n\n// Checks if all configurations in {@code configs} are in a\n// {@link RuleStopState}. Configurations meeting this condition have reached\n// the end of the decision rule (local context) or end of start rule (full\n// context).\n//\n// @param configs the configuration set to test\n// @return {@code true} if all configurations in {@code configs} are in a\n// {@link RuleStopState}, otherwise {@code false}\nPredictionMode.allConfigsInRuleStopStates = function(configs) {\n\tfor(var i=0;i<configs.items.length;i++) {\n\t\tvar c = configs.items[i];\n        if (!(c.state instanceof RuleStopState)) {\n            return false;\n        }\n\t}\n    return true;\n};\n\n//\n// Full LL prediction termination.\n//\n// <p>Can we stop looking ahead during ATN simulation or is there some\n// uncertainty as to which alternative we will ultimately pick, after\n// consuming more input? Even if there are partial conflicts, we might know\n// that everything is going to resolve to the same minimum alternative. That\n// means we can stop since no more lookahead will change that fact. On the\n// other hand, there might be multiple conflicts that resolve to different\n// minimums. That means we need more look ahead to decide which of those\n// alternatives we should predict.</p>\n//\n// <p>The basic idea is to split the set of configurations {@code C}, into\n// conflicting subsets {@code (s, _, ctx, _)} and singleton subsets with\n// non-conflicting configurations. Two configurations conflict if they have\n// identical {@link ATNConfig//state} and {@link ATNConfig//context} values\n// but different {@link ATNConfig//alt} value, e.g. {@code (s, i, ctx, _)}\n// and {@code (s, j, ctx, _)} for {@code i!=j}.</p>\n//\n// <p>Reduce these configuration subsets to the set of possible alternatives.\n// You can compute the alternative subsets in one pass as follows:</p>\n//\n// <p>{@code A_s,ctx = {i | (s, i, ctx, _)}} for each configuration in\n// {@code C} holding {@code s} and {@code ctx} fixed.</p>\n//\n// <p>Or in pseudo-code, for each configuration {@code c} in {@code C}:</p>\n//\n// <pre>\n// map[c] U= c.{@link ATNConfig//alt alt} // map hash/equals uses s and x, not\n// alt and not pred\n// </pre>\n//\n// <p>The values in {@code map} are the set of {@code A_s,ctx} sets.</p>\n//\n// <p>If {@code |A_s,ctx|=1} then there is no conflict associated with\n// {@code s} and {@code ctx}.</p>\n//\n// <p>Reduce the subsets to singletons by choosing a minimum of each subset. If\n// the union of these alternative subsets is a singleton, then no amount of\n// more lookahead will help us. We will always pick that alternative. If,\n// however, there is more than one alternative, then we are uncertain which\n// alternative to predict and must continue looking for resolution. We may\n// or may not discover an ambiguity in the future, even if there are no\n// conflicting subsets this round.</p>\n//\n// <p>The biggest sin is to terminate early because it means we've made a\n// decision but were uncertain as to the eventual outcome. We haven't used\n// enough lookahead. On the other hand, announcing a conflict too late is no\n// big deal; you will still have the conflict. It's just inefficient. It\n// might even look until the end of file.</p>\n//\n// <p>No special consideration for semantic predicates is required because\n// predicates are evaluated on-the-fly for full LL prediction, ensuring that\n// no configuration contains a semantic context during the termination\n// check.</p>\n//\n// <p><strong>CONFLICTING CONFIGS</strong></p>\n//\n// <p>Two configurations {@code (s, i, x)} and {@code (s, j, x')}, conflict\n// when {@code i!=j} but {@code x=x'}. Because we merge all\n// {@code (s, i, _)} configurations together, that means that there are at\n// most {@code n} configurations associated with state {@code s} for\n// {@code n} possible alternatives in the decision. The merged stacks\n// complicate the comparison of configuration contexts {@code x} and\n// {@code x'}. Sam checks to see if one is a subset of the other by calling\n// merge and checking to see if the merged result is either {@code x} or\n// {@code x'}. If the {@code x} associated with lowest alternative {@code i}\n// is the superset, then {@code i} is the only possible prediction since the\n// others resolve to {@code min(i)} as well. However, if {@code x} is\n// associated with {@code j>i} then at least one stack configuration for\n// {@code j} is not in conflict with alternative {@code i}. The algorithm\n// should keep going, looking for more lookahead due to the uncertainty.</p>\n//\n// <p>For simplicity, I'm doing a equality check between {@code x} and\n// {@code x'} that lets the algorithm continue to consume lookahead longer\n// than necessary. The reason I like the equality is of course the\n// simplicity but also because that is the test you need to detect the\n// alternatives that are actually in conflict.</p>\n//\n// <p><strong>CONTINUE/STOP RULE</strong></p>\n//\n// <p>Continue if union of resolved alternative sets from non-conflicting and\n// conflicting alternative subsets has more than one alternative. We are\n// uncertain about which alternative to predict.</p>\n//\n// <p>The complete set of alternatives, {@code [i for (_,i,_)]}, tells us which\n// alternatives are still in the running for the amount of input we've\n// consumed at this point. The conflicting sets let us to strip away\n// configurations that won't lead to more states because we resolve\n// conflicts to the configuration with a minimum alternate for the\n// conflicting set.</p>\n//\n// <p><strong>CASES</strong></p>\n//\n// <ul>\n//\n// <li>no conflicts and more than 1 alternative in set =&gt; continue</li>\n//\n// <li> {@code (s, 1, x)}, {@code (s, 2, x)}, {@code (s, 3, z)},\n// {@code (s', 1, y)}, {@code (s', 2, y)} yields non-conflicting set\n// {@code {3}} U conflicting sets {@code min({1,2})} U {@code min({1,2})} =\n// {@code {1,3}} =&gt; continue\n// </li>\n//\n// <li>{@code (s, 1, x)}, {@code (s, 2, x)}, {@code (s', 1, y)},\n// {@code (s', 2, y)}, {@code (s'', 1, z)} yields non-conflicting set\n// {@code {1}} U conflicting sets {@code min({1,2})} U {@code min({1,2})} =\n// {@code {1}} =&gt; stop and predict 1</li>\n//\n// <li>{@code (s, 1, x)}, {@code (s, 2, x)}, {@code (s', 1, y)},\n// {@code (s', 2, y)} yields conflicting, reduced sets {@code {1}} U\n// {@code {1}} = {@code {1}} =&gt; stop and predict 1, can announce\n// ambiguity {@code {1,2}}</li>\n//\n// <li>{@code (s, 1, x)}, {@code (s, 2, x)}, {@code (s', 2, y)},\n// {@code (s', 3, y)} yields conflicting, reduced sets {@code {1}} U\n// {@code {2}} = {@code {1,2}} =&gt; continue</li>\n//\n// <li>{@code (s, 1, x)}, {@code (s, 2, x)}, {@code (s', 3, y)},\n// {@code (s', 4, y)} yields conflicting, reduced sets {@code {1}} U\n// {@code {3}} = {@code {1,3}} =&gt; continue</li>\n//\n// </ul>\n//\n// <p><strong>EXACT AMBIGUITY DETECTION</strong></p>\n//\n// <p>If all states report the same conflicting set of alternatives, then we\n// know we have the exact ambiguity set.</p>\n//\n// <p><code>|A_<em>i</em>|&gt;1</code> and\n// <code>A_<em>i</em> = A_<em>j</em></code> for all <em>i</em>, <em>j</em>.</p>\n//\n// <p>In other words, we continue examining lookahead until all {@code A_i}\n// have more than one alternative and all {@code A_i} are the same. If\n// {@code A={{1,2}, {1,3}}}, then regular LL prediction would terminate\n// because the resolved set is {@code {1}}. To determine what the real\n// ambiguity is, we have to know whether the ambiguity is between one and\n// two or one and three so we keep going. We can only stop prediction when\n// we need exact ambiguity detection when the sets look like\n// {@code A={{1,2}}} or {@code {{1,2},{1,2}}}, etc...</p>\n//\nPredictionMode.resolvesToJustOneViableAlt = function(altsets) {\n    return PredictionMode.getSingleViableAlt(altsets);\n};\n\n//\n// Determines if every alternative subset in {@code altsets} contains more\n// than one alternative.\n//\n// @param altsets a collection of alternative subsets\n// @return {@code true} if every {@link BitSet} in {@code altsets} has\n// {@link BitSet//cardinality cardinality} &gt; 1, otherwise {@code false}\n//\nPredictionMode.allSubsetsConflict = function(altsets) {\n    return ! PredictionMode.hasNonConflictingAltSet(altsets);\n};\n//\n// Determines if any single alternative subset in {@code altsets} contains\n// exactly one alternative.\n//\n// @param altsets a collection of alternative subsets\n// @return {@code true} if {@code altsets} contains a {@link BitSet} with\n// {@link BitSet//cardinality cardinality} 1, otherwise {@code false}\n//\nPredictionMode.hasNonConflictingAltSet = function(altsets) {\n\tfor(var i=0;i<altsets.length;i++) {\n\t\tvar alts = altsets[i];\n        if (alts.length===1) {\n            return true;\n        }\n\t}\n    return false;\n};\n\n//\n// Determines if any single alternative subset in {@code altsets} contains\n// more than one alternative.\n//\n// @param altsets a collection of alternative subsets\n// @return {@code true} if {@code altsets} contains a {@link BitSet} with\n// {@link BitSet//cardinality cardinality} &gt; 1, otherwise {@code false}\n//\nPredictionMode.hasConflictingAltSet = function(altsets) {\n\tfor(var i=0;i<altsets.length;i++) {\n\t\tvar alts = altsets[i];\n        if (alts.length>1) {\n            return true;\n        }\n\t}\n    return false;\n};\n\n//\n// Determines if every alternative subset in {@code altsets} is equivalent.\n//\n// @param altsets a collection of alternative subsets\n// @return {@code true} if every member of {@code altsets} is equal to the\n// others, otherwise {@code false}\n//\nPredictionMode.allSubsetsEqual = function(altsets) {\n    var first = null;\n\tfor(var i=0;i<altsets.length;i++) {\n\t\tvar alts = altsets[i];\n        if (first === null) {\n            first = alts;\n        } else if (alts!==first) {\n            return false;\n        }\n\t}\n    return true;\n};\n\n//\n// Returns the unique alternative predicted by all alternative subsets in\n// {@code altsets}. If no such alternative exists, this method returns\n// {@link ATN//INVALID_ALT_NUMBER}.\n//\n// @param altsets a collection of alternative subsets\n//\nPredictionMode.getUniqueAlt = function(altsets) {\n    var all = PredictionMode.getAlts(altsets);\n    if (all.length===1) {\n        return all.minValue();\n    } else {\n        return ATN.INVALID_ALT_NUMBER;\n    }\n};\n\n// Gets the complete set of represented alternatives for a collection of\n// alternative subsets. This method returns the union of each {@link BitSet}\n// in {@code altsets}.\n//\n// @param altsets a collection of alternative subsets\n// @return the set of represented alternatives in {@code altsets}\n//\nPredictionMode.getAlts = function(altsets) {\n    var all = new BitSet();\n    altsets.map( function(alts) { all.or(alts); });\n    return all;\n};\n\n//\n// This function gets the conflicting alt subsets from a configuration set.\n// For each configuration {@code c} in {@code configs}:\n//\n// <pre>\n// map[c] U= c.{@link ATNConfig//alt alt} // map hash/equals uses s and x, not\n// alt and not pred\n// </pre>\n\nPredictionMode.getConflictingAltSubsets = function(configs) {\n    var configToAlts = new Map();\n    configToAlts.hashFunction = function(cfg) { hashStuff(cfg.state.stateNumber, cfg.context); };\n    configToAlts.equalsFunction = function(c1, c2) { return c1.state.stateNumber==c2.state.stateNumber && c1.context.equals(c2.context);}\n    configs.items.map(function(cfg) {\n        var alts = configToAlts.get(cfg);\n        if (alts === null) {\n            alts = new BitSet();\n            configToAlts.put(cfg, alts);\n        }\n        alts.add(cfg.alt);\n\t});\n    return configToAlts.getValues();\n};\n\n//\n// Get a map from state to alt subset from a configuration set. For each\n// configuration {@code c} in {@code configs}:\n//\n// <pre>\n// map[c.{@link ATNConfig//state state}] U= c.{@link ATNConfig//alt alt}\n// </pre>\n//\nPredictionMode.getStateToAltMap = function(configs) {\n    var m = new AltDict();\n    configs.items.map(function(c) {\n        var alts = m.get(c.state);\n        if (alts === null) {\n            alts = new BitSet();\n            m.put(c.state, alts);\n        }\n        alts.add(c.alt);\n    });\n    return m;\n};\n\nPredictionMode.hasStateAssociatedWithOneAlt = function(configs) {\n    var values = PredictionMode.getStateToAltMap(configs).values();\n    for(var i=0;i<values.length;i++) {\n        if (values[i].length===1) {\n            return true;\n        }\n    }\n    return false;\n};\n\nPredictionMode.getSingleViableAlt = function(altsets) {\n    var result = null;\n\tfor(var i=0;i<altsets.length;i++) {\n\t\tvar alts = altsets[i];\n        var minAlt = alts.minValue();\n        if(result===null) {\n            result = minAlt;\n        } else if(result!==minAlt) { // more than 1 viable alt\n            return ATN.INVALID_ALT_NUMBER;\n        }\n\t}\n    return result;\n};\n\nexports.PredictionMode = PredictionMode;\n","//\n/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n//\n\n// A tree structure used to record the semantic context in which\n//  an ATN configuration is valid.  It's either a single predicate,\n//  a conjunction {@code p1&&p2}, or a sum of products {@code p1||p2}.\n//\n//  <p>I have scoped the {@link AND}, {@link OR}, and {@link Predicate} subclasses of\n//  {@link SemanticContext} within the scope of this outer class.</p>\n//\n\nvar Set = require('./../Utils').Set;\nvar Hash = require('./../Utils').Hash;\n\nfunction SemanticContext() {\n\treturn this;\n}\n\nSemanticContext.prototype.hashCode = function() {\n    var hash = new Hash();\n    this.updateHashCode(hash);\n    return hash.finish();\n};\n\n// For context independent predicates, we evaluate them without a local\n// context (i.e., null context). That way, we can evaluate them without\n// having to create proper rule-specific context during prediction (as\n// opposed to the parser, which creates them naturally). In a practical\n// sense, this avoids a cast exception from RuleContext to myruleContext.\n//\n// <p>For context dependent predicates, we must pass in a local context so that\n// references such as $arg evaluate properly as _localctx.arg. We only\n// capture context dependent predicates in the context in which we begin\n// prediction, so we passed in the outer context here in case of context\n// dependent predicate evaluation.</p>\n//\nSemanticContext.prototype.evaluate = function(parser, outerContext) {\n};\n\n//\n// Evaluate the precedence predicates for the context and reduce the result.\n//\n// @param parser The parser instance.\n// @param outerContext The current parser context object.\n// @return The simplified semantic context after precedence predicates are\n// evaluated, which will be one of the following values.\n// <ul>\n// <li>{@link //NONE}: if the predicate simplifies to {@code true} after\n// precedence predicates are evaluated.</li>\n// <li>{@code null}: if the predicate simplifies to {@code false} after\n// precedence predicates are evaluated.</li>\n// <li>{@code this}: if the semantic context is not changed as a result of\n// precedence predicate evaluation.</li>\n// <li>A non-{@code null} {@link SemanticContext}: the new simplified\n// semantic context after precedence predicates are evaluated.</li>\n// </ul>\n//\nSemanticContext.prototype.evalPrecedence = function(parser, outerContext) {\n\treturn this;\n};\n\nSemanticContext.andContext = function(a, b) {\n\tif (a === null || a === SemanticContext.NONE) {\n\t\treturn b;\n\t}\n\tif (b === null || b === SemanticContext.NONE) {\n\t\treturn a;\n\t}\n\tvar result = new AND(a, b);\n\tif (result.opnds.length === 1) {\n\t\treturn result.opnds[0];\n\t} else {\n\t\treturn result;\n\t}\n};\n\nSemanticContext.orContext = function(a, b) {\n\tif (a === null) {\n\t\treturn b;\n\t}\n\tif (b === null) {\n\t\treturn a;\n\t}\n\tif (a === SemanticContext.NONE || b === SemanticContext.NONE) {\n\t\treturn SemanticContext.NONE;\n\t}\n\tvar result = new OR(a, b);\n\tif (result.opnds.length === 1) {\n\t\treturn result.opnds[0];\n\t} else {\n\t\treturn result;\n\t}\n};\n\nfunction Predicate(ruleIndex, predIndex, isCtxDependent) {\n\tSemanticContext.call(this);\n\tthis.ruleIndex = ruleIndex === undefined ? -1 : ruleIndex;\n\tthis.predIndex = predIndex === undefined ? -1 : predIndex;\n\tthis.isCtxDependent = isCtxDependent === undefined ? false : isCtxDependent; // e.g., $i ref in pred\n\treturn this;\n}\n\nPredicate.prototype = Object.create(SemanticContext.prototype);\nPredicate.prototype.constructor = Predicate;\n\n//The default {@link SemanticContext}, which is semantically equivalent to\n//a predicate of the form {@code {true}?}.\n//\nSemanticContext.NONE = new Predicate();\n\n\nPredicate.prototype.evaluate = function(parser, outerContext) {\n\tvar localctx = this.isCtxDependent ? outerContext : null;\n\treturn parser.sempred(localctx, this.ruleIndex, this.predIndex);\n};\n\nPredicate.prototype.updateHashCode = function(hash) {\n\thash.update(this.ruleIndex, this.predIndex, this.isCtxDependent);\n};\n\nPredicate.prototype.equals = function(other) {\n\tif (this === other) {\n\t\treturn true;\n\t} else if (!(other instanceof Predicate)) {\n\t\treturn false;\n\t} else {\n\t\treturn this.ruleIndex === other.ruleIndex &&\n\t\t\t\tthis.predIndex === other.predIndex &&\n\t\t\t\tthis.isCtxDependent === other.isCtxDependent;\n\t}\n};\n\nPredicate.prototype.toString = function() {\n\treturn \"{\" + this.ruleIndex + \":\" + this.predIndex + \"}?\";\n};\n\nfunction PrecedencePredicate(precedence) {\n\tSemanticContext.call(this);\n\tthis.precedence = precedence === undefined ? 0 : precedence;\n}\n\nPrecedencePredicate.prototype = Object.create(SemanticContext.prototype);\nPrecedencePredicate.prototype.constructor = PrecedencePredicate;\n\nPrecedencePredicate.prototype.evaluate = function(parser, outerContext) {\n\treturn parser.precpred(outerContext, this.precedence);\n};\n\nPrecedencePredicate.prototype.evalPrecedence = function(parser, outerContext) {\n\tif (parser.precpred(outerContext, this.precedence)) {\n\t\treturn SemanticContext.NONE;\n\t} else {\n\t\treturn null;\n\t}\n};\n\nPrecedencePredicate.prototype.compareTo = function(other) {\n\treturn this.precedence - other.precedence;\n};\n\nPrecedencePredicate.prototype.updateHashCode = function(hash) {\n    hash.update(31);\n};\n\nPrecedencePredicate.prototype.equals = function(other) {\n\tif (this === other) {\n\t\treturn true;\n\t} else if (!(other instanceof PrecedencePredicate)) {\n\t\treturn false;\n\t} else {\n\t\treturn this.precedence === other.precedence;\n\t}\n};\n\nPrecedencePredicate.prototype.toString = function() {\n\treturn \"{\"+this.precedence+\">=prec}?\";\n};\n\n\n\nPrecedencePredicate.filterPrecedencePredicates = function(set) {\n\tvar result = [];\n\tset.values().map( function(context) {\n\t\tif (context instanceof PrecedencePredicate) {\n\t\t\tresult.push(context);\n\t\t}\n\t});\n\treturn result;\n};\n\n\n// A semantic context which is true whenever none of the contained contexts\n// is false.\n//\nfunction AND(a, b) {\n\tSemanticContext.call(this);\n\tvar operands = new Set();\n\tif (a instanceof AND) {\n\t\ta.opnds.map(function(o) {\n\t\t\toperands.add(o);\n\t\t});\n\t} else {\n\t\toperands.add(a);\n\t}\n\tif (b instanceof AND) {\n\t\tb.opnds.map(function(o) {\n\t\t\toperands.add(o);\n\t\t});\n\t} else {\n\t\toperands.add(b);\n\t}\n\tvar precedencePredicates = PrecedencePredicate.filterPrecedencePredicates(operands);\n\tif (precedencePredicates.length > 0) {\n\t\t// interested in the transition with the lowest precedence\n\t\tvar reduced = null;\n\t\tprecedencePredicates.map( function(p) {\n\t\t\tif(reduced===null || p.precedence<reduced.precedence) {\n\t\t\t\treduced = p;\n\t\t\t}\n\t\t});\n\t\toperands.add(reduced);\n\t}\n\tthis.opnds = operands.values();\n\treturn this;\n}\n\nAND.prototype = Object.create(SemanticContext.prototype);\nAND.prototype.constructor = AND;\n\nAND.prototype.equals = function(other) {\n\tif (this === other) {\n\t\treturn true;\n\t} else if (!(other instanceof AND)) {\n\t\treturn false;\n\t} else {\n\t\treturn this.opnds === other.opnds;\n\t}\n};\n\nAND.prototype.updateHashCode = function(hash) {\n    hash.update(this.opnds, \"AND\");\n};\n//\n// {@inheritDoc}\n//\n// <p>\n// The evaluation of predicates by this context is short-circuiting, but\n// unordered.</p>\n//\nAND.prototype.evaluate = function(parser, outerContext) {\n\tfor (var i = 0; i < this.opnds.length; i++) {\n\t\tif (!this.opnds[i].evaluate(parser, outerContext)) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n};\n\nAND.prototype.evalPrecedence = function(parser, outerContext) {\n\tvar differs = false;\n\tvar operands = [];\n\tfor (var i = 0; i < this.opnds.length; i++) {\n\t\tvar context = this.opnds[i];\n\t\tvar evaluated = context.evalPrecedence(parser, outerContext);\n\t\tdiffers |= (evaluated !== context);\n\t\tif (evaluated === null) {\n\t\t\t// The AND context is false if any element is false\n\t\t\treturn null;\n\t\t} else if (evaluated !== SemanticContext.NONE) {\n\t\t\t// Reduce the result by skipping true elements\n\t\t\toperands.push(evaluated);\n\t\t}\n\t}\n\tif (!differs) {\n\t\treturn this;\n\t}\n\tif (operands.length === 0) {\n\t\t// all elements were true, so the AND context is true\n\t\treturn SemanticContext.NONE;\n\t}\n\tvar result = null;\n\toperands.map(function(o) {\n\t\tresult = result === null ? o : SemanticContext.andContext(result, o);\n\t});\n\treturn result;\n};\n\nAND.prototype.toString = function() {\n\tvar s = \"\";\n\tthis.opnds.map(function(o) {\n\t\ts += \"&& \" + o.toString();\n\t});\n\treturn s.length > 3 ? s.slice(3) : s;\n};\n\n//\n// A semantic context which is true whenever at least one of the contained\n// contexts is true.\n//\nfunction OR(a, b) {\n\tSemanticContext.call(this);\n\tvar operands = new Set();\n\tif (a instanceof OR) {\n\t\ta.opnds.map(function(o) {\n\t\t\toperands.add(o);\n\t\t});\n\t} else {\n\t\toperands.add(a);\n\t}\n\tif (b instanceof OR) {\n\t\tb.opnds.map(function(o) {\n\t\t\toperands.add(o);\n\t\t});\n\t} else {\n\t\toperands.add(b);\n\t}\n\n\tvar precedencePredicates = PrecedencePredicate.filterPrecedencePredicates(operands);\n\tif (precedencePredicates.length > 0) {\n\t\t// interested in the transition with the highest precedence\n\t\tvar s = precedencePredicates.sort(function(a, b) {\n\t\t\treturn a.compareTo(b);\n\t\t});\n\t\tvar reduced = s[s.length-1];\n\t\toperands.add(reduced);\n\t}\n\tthis.opnds = operands.values();\n\treturn this;\n}\n\nOR.prototype = Object.create(SemanticContext.prototype);\nOR.prototype.constructor = OR;\n\nOR.prototype.constructor = function(other) {\n\tif (this === other) {\n\t\treturn true;\n\t} else if (!(other instanceof OR)) {\n\t\treturn false;\n\t} else {\n\t\treturn this.opnds === other.opnds;\n\t}\n};\n\nOR.prototype.updateHashCode = function(hash) {\n    hash.update(this.opnds, \"OR\");\n};\n\n// <p>\n// The evaluation of predicates by this context is short-circuiting, but\n// unordered.</p>\n//\nOR.prototype.evaluate = function(parser, outerContext) {\n\tfor (var i = 0; i < this.opnds.length; i++) {\n\t\tif (this.opnds[i].evaluate(parser, outerContext)) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n};\n\nOR.prototype.evalPrecedence = function(parser, outerContext) {\n\tvar differs = false;\n\tvar operands = [];\n\tfor (var i = 0; i < this.opnds.length; i++) {\n\t\tvar context = this.opnds[i];\n\t\tvar evaluated = context.evalPrecedence(parser, outerContext);\n\t\tdiffers |= (evaluated !== context);\n\t\tif (evaluated === SemanticContext.NONE) {\n\t\t\t// The OR context is true if any element is true\n\t\t\treturn SemanticContext.NONE;\n\t\t} else if (evaluated !== null) {\n\t\t\t// Reduce the result by skipping false elements\n\t\t\toperands.push(evaluated);\n\t\t}\n\t}\n\tif (!differs) {\n\t\treturn this;\n\t}\n\tif (operands.length === 0) {\n\t\t// all elements were false, so the OR context is false\n\t\treturn null;\n\t}\n\tvar result = null;\n\toperands.map(function(o) {\n\t\treturn result === null ? o : SemanticContext.orContext(result, o);\n\t});\n\treturn result;\n};\n\nOR.prototype.toString = function() {\n\tvar s = \"\";\n\tthis.opnds.map(function(o) {\n\t\ts += \"|| \" + o.toString();\n\t});\n\treturn s.length > 3 ? s.slice(3) : s;\n};\n\nexports.SemanticContext = SemanticContext;\nexports.PrecedencePredicate = PrecedencePredicate;\nexports.Predicate = Predicate;\n","/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n//\n\n//  An ATN transition between any two ATN states.  Subclasses define\n//  atom, set, epsilon, action, predicate, rule transitions.\n//\n//  <p>This is a one way link.  It emanates from a state (usually via a list of\n//  transitions) and has a target state.</p>\n//\n//  <p>Since we never have to change the ATN transitions once we construct it,\n//  we can fix these transitions as specific classes. The DFA transitions\n//  on the other hand need to update the labels as it adds transitions to\n//  the states. We'll use the term Edge for the DFA to distinguish them from\n//  ATN transitions.</p>\n\nvar Token = require('./../Token').Token;\nvar Interval = require('./../IntervalSet').Interval;\nvar IntervalSet = require('./../IntervalSet').IntervalSet;\nvar Predicate = require('./SemanticContext').Predicate;\nvar PrecedencePredicate = require('./SemanticContext').PrecedencePredicate;\n\nfunction Transition (target) {\n    // The target of this transition.\n    if (target===undefined || target===null) {\n        throw \"target cannot be null.\";\n    }\n    this.target = target;\n    // Are we epsilon, action, sempred?\n    this.isEpsilon = false;\n    this.label = null;\n    return this;\n}\n    // constants for serialization\nTransition.EPSILON = 1;\nTransition.RANGE = 2;\nTransition.RULE = 3;\nTransition.PREDICATE = 4; // e.g., {isType(input.LT(1))}?\nTransition.ATOM = 5;\nTransition.ACTION = 6;\nTransition.SET = 7; // ~(A|B) or ~atom, wildcard, which convert to next 2\nTransition.NOT_SET = 8;\nTransition.WILDCARD = 9;\nTransition.PRECEDENCE = 10;\n\nTransition.serializationNames = [\n            \"INVALID\",\n            \"EPSILON\",\n            \"RANGE\",\n            \"RULE\",\n            \"PREDICATE\",\n            \"ATOM\",\n            \"ACTION\",\n            \"SET\",\n            \"NOT_SET\",\n            \"WILDCARD\",\n            \"PRECEDENCE\"\n        ];\n\nTransition.serializationTypes = {\n        EpsilonTransition: Transition.EPSILON,\n        RangeTransition: Transition.RANGE,\n        RuleTransition: Transition.RULE,\n        PredicateTransition: Transition.PREDICATE,\n        AtomTransition: Transition.ATOM,\n        ActionTransition: Transition.ACTION,\n        SetTransition: Transition.SET,\n        NotSetTransition: Transition.NOT_SET,\n        WildcardTransition: Transition.WILDCARD,\n        PrecedencePredicateTransition: Transition.PRECEDENCE\n    };\n\n\n// TODO: make all transitions sets? no, should remove set edges\nfunction AtomTransition(target, label) {\n\tTransition.call(this, target);\n\tthis.label_ = label; // The token type or character value; or, signifies special label.\n    this.label = this.makeLabel();\n    this.serializationType = Transition.ATOM;\n    return this;\n}\n\nAtomTransition.prototype = Object.create(Transition.prototype);\nAtomTransition.prototype.constructor = AtomTransition;\n\nAtomTransition.prototype.makeLabel = function() {\n\tvar s = new IntervalSet();\n    s.addOne(this.label_);\n    return s;\n};\n\nAtomTransition.prototype.matches = function( symbol, minVocabSymbol,  maxVocabSymbol) {\n    return this.label_ === symbol;\n};\n\nAtomTransition.prototype.toString = function() {\n\treturn this.label_;\n};\n\nfunction RuleTransition(ruleStart, ruleIndex, precedence, followState) {\n\tTransition.call(this, ruleStart);\n    this.ruleIndex = ruleIndex; // ptr to the rule definition object for this rule ref\n    this.precedence = precedence;\n    this.followState = followState; // what node to begin computations following ref to rule\n    this.serializationType = Transition.RULE;\n    this.isEpsilon = true;\n    return this;\n}\n\nRuleTransition.prototype = Object.create(Transition.prototype);\nRuleTransition.prototype.constructor = RuleTransition;\n\nRuleTransition.prototype.matches = function(symbol, minVocabSymbol,  maxVocabSymbol) {\n\treturn false;\n};\n\n\nfunction EpsilonTransition(target, outermostPrecedenceReturn) {\n\tTransition.call(this, target);\n    this.serializationType = Transition.EPSILON;\n    this.isEpsilon = true;\n    this.outermostPrecedenceReturn = outermostPrecedenceReturn;\n    return this;\n}\n\nEpsilonTransition.prototype = Object.create(Transition.prototype);\nEpsilonTransition.prototype.constructor = EpsilonTransition;\n\nEpsilonTransition.prototype.matches = function( symbol, minVocabSymbol,  maxVocabSymbol) {\n\treturn false;\n};\n\nEpsilonTransition.prototype.toString = function() {\n\treturn \"epsilon\";\n};\n\nfunction RangeTransition(target, start, stop) {\n\tTransition.call(this, target);\n\tthis.serializationType = Transition.RANGE;\n    this.start = start;\n    this.stop = stop;\n    this.label = this.makeLabel();\n    return this;\n}\n\nRangeTransition.prototype = Object.create(Transition.prototype);\nRangeTransition.prototype.constructor = RangeTransition;\n\nRangeTransition.prototype.makeLabel = function() {\n    var s = new IntervalSet();\n    s.addRange(this.start, this.stop);\n    return s;\n};\n\nRangeTransition.prototype.matches = function(symbol, minVocabSymbol,  maxVocabSymbol) {\n\treturn symbol >= this.start && symbol <= this.stop;\n};\n\nRangeTransition.prototype.toString = function() {\n\treturn \"'\" + String.fromCharCode(this.start) + \"'..'\" + String.fromCharCode(this.stop) + \"'\";\n};\n\nfunction AbstractPredicateTransition(target) {\n\tTransition.call(this, target);\n\treturn this;\n}\n\nAbstractPredicateTransition.prototype = Object.create(Transition.prototype);\nAbstractPredicateTransition.prototype.constructor = AbstractPredicateTransition;\n\nfunction PredicateTransition(target, ruleIndex, predIndex, isCtxDependent) {\n\tAbstractPredicateTransition.call(this, target);\n    this.serializationType = Transition.PREDICATE;\n    this.ruleIndex = ruleIndex;\n    this.predIndex = predIndex;\n    this.isCtxDependent = isCtxDependent; // e.g., $i ref in pred\n    this.isEpsilon = true;\n    return this;\n}\n\nPredicateTransition.prototype = Object.create(AbstractPredicateTransition.prototype);\nPredicateTransition.prototype.constructor = PredicateTransition;\n\nPredicateTransition.prototype.matches = function(symbol, minVocabSymbol,  maxVocabSymbol) {\n\treturn false;\n};\n\nPredicateTransition.prototype.getPredicate = function() {\n\treturn new Predicate(this.ruleIndex, this.predIndex, this.isCtxDependent);\n};\n\nPredicateTransition.prototype.toString = function() {\n\treturn \"pred_\" + this.ruleIndex + \":\" + this.predIndex;\n};\n\nfunction ActionTransition(target, ruleIndex, actionIndex, isCtxDependent) {\n\tTransition.call(this, target);\n    this.serializationType = Transition.ACTION;\n    this.ruleIndex = ruleIndex;\n    this.actionIndex = actionIndex===undefined ? -1 : actionIndex;\n    this.isCtxDependent = isCtxDependent===undefined ? false : isCtxDependent; // e.g., $i ref in pred\n    this.isEpsilon = true;\n    return this;\n}\n\nActionTransition.prototype = Object.create(Transition.prototype);\nActionTransition.prototype.constructor = ActionTransition;\n\n\nActionTransition.prototype.matches = function(symbol, minVocabSymbol,  maxVocabSymbol) {\n\treturn false;\n};\n\nActionTransition.prototype.toString = function() {\n\treturn \"action_\" + this.ruleIndex + \":\" + this.actionIndex;\n};\n\n\n// A transition containing a set of values.\nfunction SetTransition(target, set) {\n\tTransition.call(this, target);\n\tthis.serializationType = Transition.SET;\n    if (set !==undefined && set !==null) {\n        this.label = set;\n    } else {\n        this.label = new IntervalSet();\n        this.label.addOne(Token.INVALID_TYPE);\n    }\n    return this;\n}\n\nSetTransition.prototype = Object.create(Transition.prototype);\nSetTransition.prototype.constructor = SetTransition;\n\nSetTransition.prototype.matches = function(symbol, minVocabSymbol,  maxVocabSymbol) {\n\treturn this.label.contains(symbol);\n};\n\n\nSetTransition.prototype.toString = function() {\n\treturn this.label.toString();\n};\n\nfunction NotSetTransition(target, set) {\n\tSetTransition.call(this, target, set);\n\tthis.serializationType = Transition.NOT_SET;\n\treturn this;\n}\n\nNotSetTransition.prototype = Object.create(SetTransition.prototype);\nNotSetTransition.prototype.constructor = NotSetTransition;\n\nNotSetTransition.prototype.matches = function(symbol, minVocabSymbol,  maxVocabSymbol) {\n\treturn symbol >= minVocabSymbol && symbol <= maxVocabSymbol &&\n\t\t\t!SetTransition.prototype.matches.call(this, symbol, minVocabSymbol, maxVocabSymbol);\n};\n\nNotSetTransition.prototype.toString = function() {\n\treturn '~' + SetTransition.prototype.toString.call(this);\n};\n\nfunction WildcardTransition(target) {\n\tTransition.call(this, target);\n\tthis.serializationType = Transition.WILDCARD;\n\treturn this;\n}\n\nWildcardTransition.prototype = Object.create(Transition.prototype);\nWildcardTransition.prototype.constructor = WildcardTransition;\n\n\nWildcardTransition.prototype.matches = function(symbol, minVocabSymbol,  maxVocabSymbol) {\n\treturn symbol >= minVocabSymbol && symbol <= maxVocabSymbol;\n};\n\nWildcardTransition.prototype.toString = function() {\n\treturn \".\";\n};\n\nfunction PrecedencePredicateTransition(target, precedence) {\n\tAbstractPredicateTransition.call(this, target);\n    this.serializationType = Transition.PRECEDENCE;\n    this.precedence = precedence;\n    this.isEpsilon = true;\n    return this;\n}\n\nPrecedencePredicateTransition.prototype = Object.create(AbstractPredicateTransition.prototype);\nPrecedencePredicateTransition.prototype.constructor = PrecedencePredicateTransition;\n\nPrecedencePredicateTransition.prototype.matches = function(symbol, minVocabSymbol,  maxVocabSymbol) {\n\treturn false;\n};\n\nPrecedencePredicateTransition.prototype.getPredicate = function() {\n\treturn new PrecedencePredicate(this.precedence);\n};\n\nPrecedencePredicateTransition.prototype.toString = function() {\n\treturn this.precedence + \" >= _p\";\n};\n\nexports.Transition = Transition;\nexports.AtomTransition = AtomTransition;\nexports.SetTransition = SetTransition;\nexports.NotSetTransition = NotSetTransition;\nexports.RuleTransition = RuleTransition;\nexports.ActionTransition = ActionTransition;\nexports.EpsilonTransition = EpsilonTransition;\nexports.RangeTransition = RangeTransition;\nexports.WildcardTransition = WildcardTransition;\nexports.PredicateTransition = PredicateTransition;\nexports.PrecedencePredicateTransition = PrecedencePredicateTransition;\nexports.AbstractPredicateTransition = AbstractPredicateTransition;","/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n\nexports.ATN = require('./ATN').ATN;\nexports.ATNDeserializer = require('./ATNDeserializer').ATNDeserializer;\nexports.LexerATNSimulator = require('./LexerATNSimulator').LexerATNSimulator;\nexports.ParserATNSimulator = require('./ParserATNSimulator').ParserATNSimulator;\nexports.PredictionMode = require('./PredictionMode').PredictionMode;\n","//\n/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n\nvar Set = require(\"../Utils\").Set;\nvar DFAState = require('./DFAState').DFAState;\nvar StarLoopEntryState = require('../atn/ATNState').StarLoopEntryState;\nvar ATNConfigSet = require('./../atn/ATNConfigSet').ATNConfigSet;\nvar DFASerializer = require('./DFASerializer').DFASerializer;\nvar LexerDFASerializer = require('./DFASerializer').LexerDFASerializer;\n\n\n\nfunction DFA(atnStartState, decision) {\n\tif (decision === undefined) {\n\t\tdecision = 0;\n\t}\n\t// From which ATN state did we create this DFA?\n\tthis.atnStartState = atnStartState;\n\tthis.decision = decision;\n\t// A set of all DFA states. Use {@link Map} so we can get old state back\n\t// ({@link Set} only allows you to see if it's there).\n\tthis._states = new Set();\n\tthis.s0 = null;\n\t// {@code true} if this DFA is for a precedence decision; otherwise,\n\t// {@code false}. This is the backing field for {@link //isPrecedenceDfa},\n\t// {@link //setPrecedenceDfa}.\n\tthis.precedenceDfa = false;\n    if (atnStartState instanceof StarLoopEntryState)\n    {\n        if (atnStartState.isPrecedenceDecision) {\n            this.precedenceDfa = true;\n            var precedenceState = new DFAState(null, new ATNConfigSet());\n            precedenceState.edges = [];\n            precedenceState.isAcceptState = false;\n            precedenceState.requiresFullContext = false;\n            this.s0 = precedenceState;\n        }\n    }\n\treturn this;\n}\n\n// Get the start state for a specific precedence value.\n//\n// @param precedence The current precedence.\n// @return The start state corresponding to the specified precedence, or\n// {@code null} if no start state exists for the specified precedence.\n//\n// @throws IllegalStateException if this is not a precedence DFA.\n// @see //isPrecedenceDfa()\n\nDFA.prototype.getPrecedenceStartState = function(precedence) {\n\tif (!(this.precedenceDfa)) {\n\t\tthrow (\"Only precedence DFAs may contain a precedence start state.\");\n\t}\n\t// s0.edges is never null for a precedence DFA\n\tif (precedence < 0 || precedence >= this.s0.edges.length) {\n\t\treturn null;\n\t}\n\treturn this.s0.edges[precedence] || null;\n};\n\n// Set the start state for a specific precedence value.\n//\n// @param precedence The current precedence.\n// @param startState The start state corresponding to the specified\n// precedence.\n//\n// @throws IllegalStateException if this is not a precedence DFA.\n// @see //isPrecedenceDfa()\n//\nDFA.prototype.setPrecedenceStartState = function(precedence, startState) {\n\tif (!(this.precedenceDfa)) {\n\t\tthrow (\"Only precedence DFAs may contain a precedence start state.\");\n\t}\n\tif (precedence < 0) {\n\t\treturn;\n\t}\n\n\t// synchronization on s0 here is ok. when the DFA is turned into a\n\t// precedence DFA, s0 will be initialized once and not updated again\n\t// s0.edges is never null for a precedence DFA\n\tthis.s0.edges[precedence] = startState;\n};\n\n//\n// Sets whether this is a precedence DFA. If the specified value differs\n// from the current DFA configuration, the following actions are taken;\n// otherwise no changes are made to the current DFA.\n//\n// <ul>\n// <li>The {@link //states} map is cleared</li>\n// <li>If {@code precedenceDfa} is {@code false}, the initial state\n// {@link //s0} is set to {@code null}; otherwise, it is initialized to a new\n// {@link DFAState} with an empty outgoing {@link DFAState//edges} array to\n// store the start states for individual precedence values.</li>\n// <li>The {@link //precedenceDfa} field is updated</li>\n// </ul>\n//\n// @param precedenceDfa {@code true} if this is a precedence DFA; otherwise,\n// {@code false}\n\nDFA.prototype.setPrecedenceDfa = function(precedenceDfa) {\n\tif (this.precedenceDfa!==precedenceDfa) {\n\t\tthis._states = new DFAStatesSet();\n\t\tif (precedenceDfa) {\n\t\t\tvar precedenceState = new DFAState(null, new ATNConfigSet());\n\t\t\tprecedenceState.edges = [];\n\t\t\tprecedenceState.isAcceptState = false;\n\t\t\tprecedenceState.requiresFullContext = false;\n\t\t\tthis.s0 = precedenceState;\n\t\t} else {\n\t\t\tthis.s0 = null;\n\t\t}\n\t\tthis.precedenceDfa = precedenceDfa;\n\t}\n};\n\nObject.defineProperty(DFA.prototype, \"states\", {\n\tget : function() {\n\t\treturn this._states;\n\t}\n});\n\n// Return a list of all states in this DFA, ordered by state number.\nDFA.prototype.sortedStates = function() {\n\tvar list = this._states.values();\n\treturn list.sort(function(a, b) {\n\t\treturn a.stateNumber - b.stateNumber;\n\t});\n};\n\nDFA.prototype.toString = function(literalNames, symbolicNames) {\n\tliteralNames = literalNames || null;\n\tsymbolicNames = symbolicNames || null;\n\tif (this.s0 === null) {\n\t\treturn \"\";\n\t}\n\tvar serializer = new DFASerializer(this, literalNames, symbolicNames);\n\treturn serializer.toString();\n};\n\nDFA.prototype.toLexerString = function() {\n\tif (this.s0 === null) {\n\t\treturn \"\";\n\t}\n\tvar serializer = new LexerDFASerializer(this);\n\treturn serializer.toString();\n};\n\nexports.DFA = DFA;\n","/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n\n// A DFA walker that knows how to dump them to serialized strings.#/\n\n\nfunction DFASerializer(dfa, literalNames, symbolicNames) {\n\tthis.dfa = dfa;\n\tthis.literalNames = literalNames || [];\n\tthis.symbolicNames = symbolicNames || [];\n\treturn this;\n}\n\nDFASerializer.prototype.toString = function() {\n   if(this.dfa.s0 === null) {\n       return null;\n   }\n   var buf = \"\";\n   var states = this.dfa.sortedStates();\n   for(var i=0;i<states.length;i++) {\n       var s = states[i];\n       if(s.edges!==null) {\n            var n = s.edges.length;\n            for(var j=0;j<n;j++) {\n                var t = s.edges[j] || null;\n                if(t!==null && t.stateNumber !== 0x7FFFFFFF) {\n                    buf = buf.concat(this.getStateString(s));\n                    buf = buf.concat(\"-\");\n                    buf = buf.concat(this.getEdgeLabel(j));\n                    buf = buf.concat(\"->\");\n                    buf = buf.concat(this.getStateString(t));\n                    buf = buf.concat('\\n');\n                }\n            }\n       }\n   }\n   return buf.length===0 ? null : buf;\n};\n\nDFASerializer.prototype.getEdgeLabel = function(i) {\n    if (i===0) {\n        return \"EOF\";\n    } else if(this.literalNames !==null || this.symbolicNames!==null) {\n        return this.literalNames[i-1] || this.symbolicNames[i-1];\n    } else {\n        return String.fromCharCode(i-1);\n    }\n};\n\nDFASerializer.prototype.getStateString = function(s) {\n    var baseStateStr = ( s.isAcceptState ? \":\" : \"\") + \"s\" + s.stateNumber + ( s.requiresFullContext ? \"^\" : \"\");\n    if(s.isAcceptState) {\n        if (s.predicates !== null) {\n            return baseStateStr + \"=>\" + s.predicates.toString();\n        } else {\n            return baseStateStr + \"=>\" + s.prediction.toString();\n        }\n    } else {\n        return baseStateStr;\n    }\n};\n\nfunction LexerDFASerializer(dfa) {\n\tDFASerializer.call(this, dfa, null);\n\treturn this;\n}\n\nLexerDFASerializer.prototype = Object.create(DFASerializer.prototype);\nLexerDFASerializer.prototype.constructor = LexerDFASerializer;\n\nLexerDFASerializer.prototype.getEdgeLabel = function(i) {\n\treturn \"'\" + String.fromCharCode(i) + \"'\";\n};\n\nexports.DFASerializer = DFASerializer;\nexports.LexerDFASerializer = LexerDFASerializer;\n\n","//\n/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n///\n\nvar ATNConfigSet = require('./../atn/ATNConfigSet').ATNConfigSet;\nvar Utils = require('./../Utils');\nvar Hash = Utils.Hash;\nvar Set = Utils.Set;\n\n// Map a predicate to a predicted alternative.///\n\nfunction PredPrediction(pred, alt) {\n\tthis.alt = alt;\n\tthis.pred = pred;\n\treturn this;\n}\n\nPredPrediction.prototype.toString = function() {\n\treturn \"(\" + this.pred + \", \" + this.alt + \")\";\n};\n\n// A DFA state represents a set of possible ATN configurations.\n// As Aho, Sethi, Ullman p. 117 says \"The DFA uses its state\n// to keep track of all possible states the ATN can be in after\n// reading each input symbol. That is to say, after reading\n// input a1a2..an, the DFA is in a state that represents the\n// subset T of the states of the ATN that are reachable from the\n// ATN's start state along some path labeled a1a2..an.\"\n// In conventional NFA&rarr;DFA conversion, therefore, the subset T\n// would be a bitset representing the set of states the\n// ATN could be in. We need to track the alt predicted by each\n// state as well, however. More importantly, we need to maintain\n// a stack of states, tracking the closure operations as they\n// jump from rule to rule, emulating rule invocations (method calls).\n// I have to add a stack to simulate the proper lookahead sequences for\n// the underlying LL grammar from which the ATN was derived.\n//\n// <p>I use a set of ATNConfig objects not simple states. An ATNConfig\n// is both a state (ala normal conversion) and a RuleContext describing\n// the chain of rules (if any) followed to arrive at that state.</p>\n//\n// <p>A DFA state may have multiple references to a particular state,\n// but with different ATN contexts (with same or different alts)\n// meaning that state was reached via a different set of rule invocations.</p>\n// /\n\nfunction DFAState(stateNumber, configs) {\n\tif (stateNumber === null) {\n\t\tstateNumber = -1;\n\t}\n\tif (configs === null) {\n\t\tconfigs = new ATNConfigSet();\n\t}\n\tthis.stateNumber = stateNumber;\n\tthis.configs = configs;\n\t// {@code edges[symbol]} points to target of symbol. Shift up by 1 so (-1)\n\t// {@link Token//EOF} maps to {@code edges[0]}.\n\tthis.edges = null;\n\tthis.isAcceptState = false;\n\t// if accept state, what ttype do we match or alt do we predict?\n\t// This is set to {@link ATN//INVALID_ALT_NUMBER} when {@link\n\t// //predicates}{@code !=null} or\n\t// {@link //requiresFullContext}.\n\tthis.prediction = 0;\n\tthis.lexerActionExecutor = null;\n\t// Indicates that this state was created during SLL prediction that\n\t// discovered a conflict between the configurations in the state. Future\n\t// {@link ParserATNSimulator//execATN} invocations immediately jumped doing\n\t// full context prediction if this field is true.\n\tthis.requiresFullContext = false;\n\t// During SLL parsing, this is a list of predicates associated with the\n\t// ATN configurations of the DFA state. When we have predicates,\n\t// {@link //requiresFullContext} is {@code false} since full context\n\t// prediction evaluates predicates\n\t// on-the-fly. If this is not null, then {@link //prediction} is\n\t// {@link ATN//INVALID_ALT_NUMBER}.\n\t//\n\t// <p>We only use these for non-{@link //requiresFullContext} but\n\t// conflicting states. That\n\t// means we know from the context (it's $ or we don't dip into outer\n\t// context) that it's an ambiguity not a conflict.</p>\n\t//\n\t// <p>This list is computed by {@link\n\t// ParserATNSimulator//predicateDFAState}.</p>\n\tthis.predicates = null;\n\treturn this;\n}\n\n// Get the set of all alts mentioned by all ATN configurations in this\n// DFA state.\nDFAState.prototype.getAltSet = function() {\n\tvar alts = new Set();\n\tif (this.configs !== null) {\n\t\tfor (var i = 0; i < this.configs.length; i++) {\n\t\t\tvar c = this.configs[i];\n\t\t\talts.add(c.alt);\n\t\t}\n\t}\n\tif (alts.length === 0) {\n\t\treturn null;\n\t} else {\n\t\treturn alts;\n\t}\n};\n\n// Two {@link DFAState} instances are equal if their ATN configuration sets\n// are the same. This method is used to see if a state already exists.\n//\n// <p>Because the number of alternatives and number of ATN configurations are\n// finite, there is a finite number of DFA states that can be processed.\n// This is necessary to show that the algorithm terminates.</p>\n//\n// <p>Cannot test the DFA state numbers here because in\n// {@link ParserATNSimulator//addDFAState} we need to know if any other state\n// exists that has this exact set of ATN configurations. The\n// {@link //stateNumber} is irrelevant.</p>\nDFAState.prototype.equals = function(other) {\n\t// compare set of ATN configurations in this set with other\n\treturn this === other ||\n\t\t\t(other instanceof DFAState &&\n\t\t\t\tthis.configs.equals(other.configs));\n};\n\nDFAState.prototype.toString = function() {\n\tvar s = \"\" + this.stateNumber + \":\" + this.configs;\n\tif(this.isAcceptState) {\n        s = s + \"=>\";\n        if (this.predicates !== null)\n            s = s + this.predicates;\n        else\n            s = s + this.prediction;\n    }\n\treturn s;\n};\n\nDFAState.prototype.hashCode = function() {\n\tvar hash = new Hash();\n\thash.update(this.configs);\n\tif(this.isAcceptState) {\n        if (this.predicates !== null)\n            hash.update(this.predicates);\n        else\n            hash.update(this.prediction);\n    }\n    return hash.finish();\n};\n\nexports.DFAState = DFAState;\nexports.PredPrediction = PredPrediction;\n","/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n\nexports.DFA = require('./DFA').DFA;\nexports.DFASerializer = require('./DFASerializer').DFASerializer;\nexports.LexerDFASerializer = require('./DFASerializer').LexerDFASerializer;\nexports.PredPrediction = require('./DFAState').PredPrediction;\n","//\n/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n//\n\n//\n// This implementation of {@link ANTLRErrorListener} can be used to identify\n// certain potential correctness and performance problems in grammars. \"Reports\"\n// are made by calling {@link Parser//notifyErrorListeners} with the appropriate\n// message.\n//\n// <ul>\n// <li><b>Ambiguities</b>: These are cases where more than one path through the\n// grammar can match the input.</li>\n// <li><b>Weak context sensitivity</b>: These are cases where full-context\n// prediction resolved an SLL conflict to a unique alternative which equaled the\n// minimum alternative of the SLL conflict.</li>\n// <li><b>Strong (forced) context sensitivity</b>: These are cases where the\n// full-context prediction resolved an SLL conflict to a unique alternative,\n// <em>and</em> the minimum alternative of the SLL conflict was found to not be\n// a truly viable alternative. Two-stage parsing cannot be used for inputs where\n// this situation occurs.</li>\n// </ul>\n\nvar BitSet = require('./../Utils').BitSet;\nvar ErrorListener = require('./ErrorListener').ErrorListener;\nvar Interval = require('./../IntervalSet').Interval;\n\nfunction DiagnosticErrorListener(exactOnly) {\n\tErrorListener.call(this);\n\texactOnly = exactOnly || true;\n\t// whether all ambiguities or only exact ambiguities are reported.\n\tthis.exactOnly = exactOnly;\n\treturn this;\n}\n\nDiagnosticErrorListener.prototype = Object.create(ErrorListener.prototype);\nDiagnosticErrorListener.prototype.constructor = DiagnosticErrorListener;\n\nDiagnosticErrorListener.prototype.reportAmbiguity = function(recognizer, dfa,\n\t\tstartIndex, stopIndex, exact, ambigAlts, configs) {\n\tif (this.exactOnly && !exact) {\n\t\treturn;\n\t}\n\tvar msg = \"reportAmbiguity d=\" +\n\t\t\tthis.getDecisionDescription(recognizer, dfa) +\n\t\t\t\": ambigAlts=\" +\n\t\t\tthis.getConflictingAlts(ambigAlts, configs) +\n\t\t\t\", input='\" +\n\t\t\trecognizer.getTokenStream().getText(new Interval(startIndex, stopIndex)) + \"'\";\n\trecognizer.notifyErrorListeners(msg);\n};\n\nDiagnosticErrorListener.prototype.reportAttemptingFullContext = function(\n\t\trecognizer, dfa, startIndex, stopIndex, conflictingAlts, configs) {\n\tvar msg = \"reportAttemptingFullContext d=\" +\n\t\t\tthis.getDecisionDescription(recognizer, dfa) +\n\t\t\t\", input='\" +\n\t\t\trecognizer.getTokenStream().getText(new Interval(startIndex, stopIndex)) + \"'\";\n\trecognizer.notifyErrorListeners(msg);\n};\n\nDiagnosticErrorListener.prototype.reportContextSensitivity = function(\n\t\trecognizer, dfa, startIndex, stopIndex, prediction, configs) {\n\tvar msg = \"reportContextSensitivity d=\" +\n\t\t\tthis.getDecisionDescription(recognizer, dfa) +\n\t\t\t\", input='\" +\n\t\t\trecognizer.getTokenStream().getText(new Interval(startIndex, stopIndex)) + \"'\";\n\trecognizer.notifyErrorListeners(msg);\n};\n\nDiagnosticErrorListener.prototype.getDecisionDescription = function(recognizer, dfa) {\n\tvar decision = dfa.decision;\n\tvar ruleIndex = dfa.atnStartState.ruleIndex;\n\n\tvar ruleNames = recognizer.ruleNames;\n\tif (ruleIndex < 0 || ruleIndex >= ruleNames.length) {\n\t\treturn \"\" + decision;\n\t}\n\tvar ruleName = ruleNames[ruleIndex] || null;\n\tif (ruleName === null || ruleName.length === 0) {\n\t\treturn \"\" + decision;\n\t}\n\treturn \"\" + decision + \" (\" + ruleName + \")\";\n};\n\n//\n// Computes the set of conflicting or ambiguous alternatives from a\n// configuration set, if that information was not already provided by the\n// parser.\n//\n// @param reportedAlts The set of conflicting or ambiguous alternatives, as\n// reported by the parser.\n// @param configs The conflicting or ambiguous configuration set.\n// @return Returns {@code reportedAlts} if it is not {@code null}, otherwise\n// returns the set of alternatives represented in {@code configs}.\n//\nDiagnosticErrorListener.prototype.getConflictingAlts = function(reportedAlts, configs) {\n\tif (reportedAlts !== null) {\n\t\treturn reportedAlts;\n\t}\n\tvar result = new BitSet();\n\tfor (var i = 0; i < configs.items.length; i++) {\n\t\tresult.add(configs.items[i].alt);\n\t}\n\treturn \"{\" + result.values().join(\", \") + \"}\";\n};\n\nexports.DiagnosticErrorListener = DiagnosticErrorListener;","//\n/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n\n// Provides an empty default implementation of {@link ANTLRErrorListener}. The\n// default implementation of each method does nothing, but can be overridden as\n// necessary.\n\nfunction ErrorListener() {\n\treturn this;\n}\n\nErrorListener.prototype.syntaxError = function(recognizer, offendingSymbol, line, column, msg, e) {\n};\n\nErrorListener.prototype.reportAmbiguity = function(recognizer, dfa, startIndex, stopIndex, exact, ambigAlts, configs) {\n};\n\nErrorListener.prototype.reportAttemptingFullContext = function(recognizer, dfa, startIndex, stopIndex, conflictingAlts, configs) {\n};\n\nErrorListener.prototype.reportContextSensitivity = function(recognizer, dfa, startIndex, stopIndex, prediction, configs) {\n};\n\nfunction ConsoleErrorListener() {\n\tErrorListener.call(this);\n\treturn this;\n}\n\nConsoleErrorListener.prototype = Object.create(ErrorListener.prototype);\nConsoleErrorListener.prototype.constructor = ConsoleErrorListener;\n\n//\n// Provides a default instance of {@link ConsoleErrorListener}.\n//\nConsoleErrorListener.INSTANCE = new ConsoleErrorListener();\n\n//\n// {@inheritDoc}\n//\n// <p>\n// This implementation prints messages to {@link System//err} containing the\n// values of {@code line}, {@code charPositionInLine}, and {@code msg} using\n// the following format.</p>\n//\n// <pre>\n// line <em>line</em>:<em>charPositionInLine</em> <em>msg</em>\n// </pre>\n//\nConsoleErrorListener.prototype.syntaxError = function(recognizer, offendingSymbol, line, column, msg, e) {\n    console.error(\"line \" + line + \":\" + column + \" \" + msg);\n};\n\nfunction ProxyErrorListener(delegates) {\n\tErrorListener.call(this);\n    if (delegates===null) {\n        throw \"delegates\";\n    }\n    this.delegates = delegates;\n\treturn this;\n}\n\nProxyErrorListener.prototype = Object.create(ErrorListener.prototype);\nProxyErrorListener.prototype.constructor = ProxyErrorListener;\n\nProxyErrorListener.prototype.syntaxError = function(recognizer, offendingSymbol, line, column, msg, e) {\n    this.delegates.map(function(d) { d.syntaxError(recognizer, offendingSymbol, line, column, msg, e); });\n};\n\nProxyErrorListener.prototype.reportAmbiguity = function(recognizer, dfa, startIndex, stopIndex, exact, ambigAlts, configs) {\n    this.delegates.map(function(d) { d.reportAmbiguity(recognizer, dfa, startIndex, stopIndex, exact, ambigAlts, configs); });\n};\n\nProxyErrorListener.prototype.reportAttemptingFullContext = function(recognizer, dfa, startIndex, stopIndex, conflictingAlts, configs) {\n\tthis.delegates.map(function(d) { d.reportAttemptingFullContext(recognizer, dfa, startIndex, stopIndex, conflictingAlts, configs); });\n};\n\nProxyErrorListener.prototype.reportContextSensitivity = function(recognizer, dfa, startIndex, stopIndex, prediction, configs) {\n\tthis.delegates.map(function(d) { d.reportContextSensitivity(recognizer, dfa, startIndex, stopIndex, prediction, configs); });\n};\n\nexports.ErrorListener = ErrorListener;\nexports.ConsoleErrorListener = ConsoleErrorListener;\nexports.ProxyErrorListener = ProxyErrorListener;\n\n","//\n/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n//\n\nvar Token = require('./../Token').Token;\nvar Errors = require('./Errors');\nvar NoViableAltException = Errors.NoViableAltException;\nvar InputMismatchException = Errors.InputMismatchException;\nvar FailedPredicateException = Errors.FailedPredicateException;\nvar ParseCancellationException = Errors.ParseCancellationException;\nvar ATNState = require('./../atn/ATNState').ATNState;\nvar Interval = require('./../IntervalSet').Interval;\nvar IntervalSet = require('./../IntervalSet').IntervalSet;\n\nfunction ErrorStrategy() {\n\n}\n\nErrorStrategy.prototype.reset = function(recognizer){\n};\n\nErrorStrategy.prototype.recoverInline = function(recognizer){\n};\n\nErrorStrategy.prototype.recover = function(recognizer, e){\n};\n\nErrorStrategy.prototype.sync = function(recognizer){\n};\n\nErrorStrategy.prototype.inErrorRecoveryMode = function(recognizer){\n};\n\nErrorStrategy.prototype.reportError = function(recognizer){\n};\n\n\n\n// This is the default implementation of {@link ANTLRErrorStrategy} used for\n// error reporting and recovery in ANTLR parsers.\n//\nfunction DefaultErrorStrategy() {\n\tErrorStrategy.call(this);\n    // Indicates whether the error strategy is currently \"recovering from an\n    // error\". This is used to suppress reporting multiple error messages while\n    // attempting to recover from a detected syntax error.\n    //\n    // @see //inErrorRecoveryMode\n    //\n    this.errorRecoveryMode = false;\n\n    // The index into the input stream where the last error occurred.\n    // This is used to prevent infinite loops where an error is found\n    // but no token is consumed during recovery...another error is found,\n    // ad nauseum. This is a failsafe mechanism to guarantee that at least\n    // one token/tree node is consumed for two errors.\n    //\n    this.lastErrorIndex = -1;\n    this.lastErrorStates = null;\n    return this;\n}\n\nDefaultErrorStrategy.prototype = Object.create(ErrorStrategy.prototype);\nDefaultErrorStrategy.prototype.constructor = DefaultErrorStrategy;\n\n// <p>The default implementation simply calls {@link //endErrorCondition} to\n// ensure that the handler is not in error recovery mode.</p>\nDefaultErrorStrategy.prototype.reset = function(recognizer) {\n    this.endErrorCondition(recognizer);\n};\n\n//\n// This method is called to enter error recovery mode when a recognition\n// exception is reported.\n//\n// @param recognizer the parser instance\n//\nDefaultErrorStrategy.prototype.beginErrorCondition = function(recognizer) {\n    this.errorRecoveryMode = true;\n};\n\nDefaultErrorStrategy.prototype.inErrorRecoveryMode = function(recognizer) {\n    return this.errorRecoveryMode;\n};\n\n//\n// This method is called to leave error recovery mode after recovering from\n// a recognition exception.\n//\n// @param recognizer\n//\nDefaultErrorStrategy.prototype.endErrorCondition = function(recognizer) {\n    this.errorRecoveryMode = false;\n    this.lastErrorStates = null;\n    this.lastErrorIndex = -1;\n};\n\n//\n// {@inheritDoc}\n//\n// <p>The default implementation simply calls {@link //endErrorCondition}.</p>\n//\nDefaultErrorStrategy.prototype.reportMatch = function(recognizer) {\n    this.endErrorCondition(recognizer);\n};\n\n//\n// {@inheritDoc}\n//\n// <p>The default implementation returns immediately if the handler is already\n// in error recovery mode. Otherwise, it calls {@link //beginErrorCondition}\n// and dispatches the reporting task based on the runtime type of {@code e}\n// according to the following table.</p>\n//\n// <ul>\n// <li>{@link NoViableAltException}: Dispatches the call to\n// {@link //reportNoViableAlternative}</li>\n// <li>{@link InputMismatchException}: Dispatches the call to\n// {@link //reportInputMismatch}</li>\n// <li>{@link FailedPredicateException}: Dispatches the call to\n// {@link //reportFailedPredicate}</li>\n// <li>All other types: calls {@link Parser//notifyErrorListeners} to report\n// the exception</li>\n// </ul>\n//\nDefaultErrorStrategy.prototype.reportError = function(recognizer, e) {\n   // if we've already reported an error and have not matched a token\n   // yet successfully, don't report any errors.\n    if(this.inErrorRecoveryMode(recognizer)) {\n        return; // don't report spurious errors\n    }\n    this.beginErrorCondition(recognizer);\n    if ( e instanceof NoViableAltException ) {\n        this.reportNoViableAlternative(recognizer, e);\n    } else if ( e instanceof InputMismatchException ) {\n        this.reportInputMismatch(recognizer, e);\n    } else if ( e instanceof FailedPredicateException ) {\n        this.reportFailedPredicate(recognizer, e);\n    } else {\n        console.log(\"unknown recognition error type: \" + e.constructor.name);\n        console.log(e.stack);\n        recognizer.notifyErrorListeners(e.getOffendingToken(), e.getMessage(), e);\n    }\n};\n//\n// {@inheritDoc}\n//\n// <p>The default implementation resynchronizes the parser by consuming tokens\n// until we find one in the resynchronization set--loosely the set of tokens\n// that can follow the current rule.</p>\n//\nDefaultErrorStrategy.prototype.recover = function(recognizer, e) {\n    if (this.lastErrorIndex===recognizer.getInputStream().index &&\n        this.lastErrorStates !== null && this.lastErrorStates.indexOf(recognizer.state)>=0) {\n\t\t// uh oh, another error at same token index and previously-visited\n\t\t// state in ATN; must be a case where LT(1) is in the recovery\n\t\t// token set so nothing got consumed. Consume a single token\n\t\t// at least to prevent an infinite loop; this is a failsafe.\n\t\trecognizer.consume();\n    }\n    this.lastErrorIndex = recognizer._input.index;\n    if (this.lastErrorStates === null) {\n        this.lastErrorStates = [];\n    }\n    this.lastErrorStates.push(recognizer.state);\n    var followSet = this.getErrorRecoverySet(recognizer);\n    this.consumeUntil(recognizer, followSet);\n};\n\n// The default implementation of {@link ANTLRErrorStrategy//sync} makes sure\n// that the current lookahead symbol is consistent with what were expecting\n// at this point in the ATN. You can call this anytime but ANTLR only\n// generates code to check before subrules/loops and each iteration.\n//\n// <p>Implements Jim Idle's magic sync mechanism in closures and optional\n// subrules. E.g.,</p>\n//\n// <pre>\n// a : sync ( stuff sync )* ;\n// sync : {consume to what can follow sync} ;\n// </pre>\n//\n// At the start of a sub rule upon error, {@link //sync} performs single\n// token deletion, if possible. If it can't do that, it bails on the current\n// rule and uses the default error recovery, which consumes until the\n// resynchronization set of the current rule.\n//\n// <p>If the sub rule is optional ({@code (...)?}, {@code (...)*}, or block\n// with an empty alternative), then the expected set includes what follows\n// the subrule.</p>\n//\n// <p>During loop iteration, it consumes until it sees a token that can start a\n// sub rule or what follows loop. Yes, that is pretty aggressive. We opt to\n// stay in the loop as long as possible.</p>\n//\n// <p><strong>ORIGINS</strong></p>\n//\n// <p>Previous versions of ANTLR did a poor job of their recovery within loops.\n// A single mismatch token or missing token would force the parser to bail\n// out of the entire rules surrounding the loop. So, for rule</p>\n//\n// <pre>\n// classDef : 'class' ID '{' member* '}'\n// </pre>\n//\n// input with an extra token between members would force the parser to\n// consume until it found the next class definition rather than the next\n// member definition of the current class.\n//\n// <p>This functionality cost a little bit of effort because the parser has to\n// compare token set at the start of the loop and at each iteration. If for\n// some reason speed is suffering for you, you can turn off this\n// functionality by simply overriding this method as a blank { }.</p>\n//\nDefaultErrorStrategy.prototype.sync = function(recognizer) {\n    // If already recovering, don't try to sync\n    if (this.inErrorRecoveryMode(recognizer)) {\n        return;\n    }\n    var s = recognizer._interp.atn.states[recognizer.state];\n    var la = recognizer.getTokenStream().LA(1);\n    // try cheaper subset first; might get lucky. seems to shave a wee bit off\n    var nextTokens = recognizer.atn.nextTokens(s);\n    if (nextTokens.contains(Token.EPSILON) || nextTokens.contains(la)) {\n        return;\n    }\n    switch (s.stateType) {\n    case ATNState.BLOCK_START:\n    case ATNState.STAR_BLOCK_START:\n    case ATNState.PLUS_BLOCK_START:\n    case ATNState.STAR_LOOP_ENTRY:\n       // report error and recover if possible\n        if( this.singleTokenDeletion(recognizer) !== null) {\n            return;\n        } else {\n            throw new InputMismatchException(recognizer);\n        }\n        break;\n    case ATNState.PLUS_LOOP_BACK:\n    case ATNState.STAR_LOOP_BACK:\n        this.reportUnwantedToken(recognizer);\n        var expecting = new IntervalSet();\n        expecting.addSet(recognizer.getExpectedTokens());\n        var whatFollowsLoopIterationOrRule = expecting.addSet(this.getErrorRecoverySet(recognizer));\n        this.consumeUntil(recognizer, whatFollowsLoopIterationOrRule);\n        break;\n    default:\n        // do nothing if we can't identify the exact kind of ATN state\n    }\n};\n\n// This is called by {@link //reportError} when the exception is a\n// {@link NoViableAltException}.\n//\n// @see //reportError\n//\n// @param recognizer the parser instance\n// @param e the recognition exception\n//\nDefaultErrorStrategy.prototype.reportNoViableAlternative = function(recognizer, e) {\n    var tokens = recognizer.getTokenStream();\n    var input;\n    if(tokens !== null) {\n        if (e.startToken.type===Token.EOF) {\n            input = \"<EOF>\";\n        } else {\n            input = tokens.getText(new Interval(e.startToken.tokenIndex, e.offendingToken.tokenIndex));\n        }\n    } else {\n        input = \"<unknown input>\";\n    }\n    var msg = \"no viable alternative at input \" + this.escapeWSAndQuote(input);\n    recognizer.notifyErrorListeners(msg, e.offendingToken, e);\n};\n\n//\n// This is called by {@link //reportError} when the exception is an\n// {@link InputMismatchException}.\n//\n// @see //reportError\n//\n// @param recognizer the parser instance\n// @param e the recognition exception\n//\nDefaultErrorStrategy.prototype.reportInputMismatch = function(recognizer, e) {\n    var msg = \"mismatched input \" + this.getTokenErrorDisplay(e.offendingToken) +\n          \" expecting \" + e.getExpectedTokens().toString(recognizer.literalNames, recognizer.symbolicNames);\n    recognizer.notifyErrorListeners(msg, e.offendingToken, e);\n};\n\n//\n// This is called by {@link //reportError} when the exception is a\n// {@link FailedPredicateException}.\n//\n// @see //reportError\n//\n// @param recognizer the parser instance\n// @param e the recognition exception\n//\nDefaultErrorStrategy.prototype.reportFailedPredicate = function(recognizer, e) {\n    var ruleName = recognizer.ruleNames[recognizer._ctx.ruleIndex];\n    var msg = \"rule \" + ruleName + \" \" + e.message;\n    recognizer.notifyErrorListeners(msg, e.offendingToken, e);\n};\n\n// This method is called to report a syntax error which requires the removal\n// of a token from the input stream. At the time this method is called, the\n// erroneous symbol is current {@code LT(1)} symbol and has not yet been\n// removed from the input stream. When this method returns,\n// {@code recognizer} is in error recovery mode.\n//\n// <p>This method is called when {@link //singleTokenDeletion} identifies\n// single-token deletion as a viable recovery strategy for a mismatched\n// input error.</p>\n//\n// <p>The default implementation simply returns if the handler is already in\n// error recovery mode. Otherwise, it calls {@link //beginErrorCondition} to\n// enter error recovery mode, followed by calling\n// {@link Parser//notifyErrorListeners}.</p>\n//\n// @param recognizer the parser instance\n//\nDefaultErrorStrategy.prototype.reportUnwantedToken = function(recognizer) {\n    if (this.inErrorRecoveryMode(recognizer)) {\n        return;\n    }\n    this.beginErrorCondition(recognizer);\n    var t = recognizer.getCurrentToken();\n    var tokenName = this.getTokenErrorDisplay(t);\n    var expecting = this.getExpectedTokens(recognizer);\n    var msg = \"extraneous input \" + tokenName + \" expecting \" +\n        expecting.toString(recognizer.literalNames, recognizer.symbolicNames);\n    recognizer.notifyErrorListeners(msg, t, null);\n};\n// This method is called to report a syntax error which requires the\n// insertion of a missing token into the input stream. At the time this\n// method is called, the missing token has not yet been inserted. When this\n// method returns, {@code recognizer} is in error recovery mode.\n//\n// <p>This method is called when {@link //singleTokenInsertion} identifies\n// single-token insertion as a viable recovery strategy for a mismatched\n// input error.</p>\n//\n// <p>The default implementation simply returns if the handler is already in\n// error recovery mode. Otherwise, it calls {@link //beginErrorCondition} to\n// enter error recovery mode, followed by calling\n// {@link Parser//notifyErrorListeners}.</p>\n//\n// @param recognizer the parser instance\n//\nDefaultErrorStrategy.prototype.reportMissingToken = function(recognizer) {\n    if ( this.inErrorRecoveryMode(recognizer)) {\n        return;\n    }\n    this.beginErrorCondition(recognizer);\n    var t = recognizer.getCurrentToken();\n    var expecting = this.getExpectedTokens(recognizer);\n    var msg = \"missing \" + expecting.toString(recognizer.literalNames, recognizer.symbolicNames) +\n          \" at \" + this.getTokenErrorDisplay(t);\n    recognizer.notifyErrorListeners(msg, t, null);\n};\n\n// <p>The default implementation attempts to recover from the mismatched input\n// by using single token insertion and deletion as described below. If the\n// recovery attempt fails, this method throws an\n// {@link InputMismatchException}.</p>\n//\n// <p><strong>EXTRA TOKEN</strong> (single token deletion)</p>\n//\n// <p>{@code LA(1)} is not what we are looking for. If {@code LA(2)} has the\n// right token, however, then assume {@code LA(1)} is some extra spurious\n// token and delete it. Then consume and return the next token (which was\n// the {@code LA(2)} token) as the successful result of the match operation.</p>\n//\n// <p>This recovery strategy is implemented by {@link\n// //singleTokenDeletion}.</p>\n//\n// <p><strong>MISSING TOKEN</strong> (single token insertion)</p>\n//\n// <p>If current token (at {@code LA(1)}) is consistent with what could come\n// after the expected {@code LA(1)} token, then assume the token is missing\n// and use the parser's {@link TokenFactory} to create it on the fly. The\n// \"insertion\" is performed by returning the created token as the successful\n// result of the match operation.</p>\n//\n// <p>This recovery strategy is implemented by {@link\n// //singleTokenInsertion}.</p>\n//\n// <p><strong>EXAMPLE</strong></p>\n//\n// <p>For example, Input {@code i=(3;} is clearly missing the {@code ')'}. When\n// the parser returns from the nested call to {@code expr}, it will have\n// call chain:</p>\n//\n// <pre>\n// stat &rarr; expr &rarr; atom\n// </pre>\n//\n// and it will be trying to match the {@code ')'} at this point in the\n// derivation:\n//\n// <pre>\n// =&gt; ID '=' '(' INT ')' ('+' atom)* ';'\n// ^\n// </pre>\n//\n// The attempt to match {@code ')'} will fail when it sees {@code ';'} and\n// call {@link //recoverInline}. To recover, it sees that {@code LA(1)==';'}\n// is in the set of tokens that can follow the {@code ')'} token reference\n// in rule {@code atom}. It can assume that you forgot the {@code ')'}.\n//\nDefaultErrorStrategy.prototype.recoverInline = function(recognizer) {\n    // SINGLE TOKEN DELETION\n    var matchedSymbol = this.singleTokenDeletion(recognizer);\n    if (matchedSymbol !== null) {\n        // we have deleted the extra token.\n        // now, move past ttype token as if all were ok\n        recognizer.consume();\n        return matchedSymbol;\n    }\n    // SINGLE TOKEN INSERTION\n    if (this.singleTokenInsertion(recognizer)) {\n        return this.getMissingSymbol(recognizer);\n    }\n    // even that didn't work; must throw the exception\n    throw new InputMismatchException(recognizer);\n};\n\n//\n// This method implements the single-token insertion inline error recovery\n// strategy. It is called by {@link //recoverInline} if the single-token\n// deletion strategy fails to recover from the mismatched input. If this\n// method returns {@code true}, {@code recognizer} will be in error recovery\n// mode.\n//\n// <p>This method determines whether or not single-token insertion is viable by\n// checking if the {@code LA(1)} input symbol could be successfully matched\n// if it were instead the {@code LA(2)} symbol. If this method returns\n// {@code true}, the caller is responsible for creating and inserting a\n// token with the correct type to produce this behavior.</p>\n//\n// @param recognizer the parser instance\n// @return {@code true} if single-token insertion is a viable recovery\n// strategy for the current mismatched input, otherwise {@code false}\n//\nDefaultErrorStrategy.prototype.singleTokenInsertion = function(recognizer) {\n    var currentSymbolType = recognizer.getTokenStream().LA(1);\n    // if current token is consistent with what could come after current\n    // ATN state, then we know we're missing a token; error recovery\n    // is free to conjure up and insert the missing token\n    var atn = recognizer._interp.atn;\n    var currentState = atn.states[recognizer.state];\n    var next = currentState.transitions[0].target;\n    var expectingAtLL2 = atn.nextTokens(next, recognizer._ctx);\n    if (expectingAtLL2.contains(currentSymbolType) ){\n        this.reportMissingToken(recognizer);\n        return true;\n    } else {\n        return false;\n    }\n};\n\n// This method implements the single-token deletion inline error recovery\n// strategy. It is called by {@link //recoverInline} to attempt to recover\n// from mismatched input. If this method returns null, the parser and error\n// handler state will not have changed. If this method returns non-null,\n// {@code recognizer} will <em>not</em> be in error recovery mode since the\n// returned token was a successful match.\n//\n// <p>If the single-token deletion is successful, this method calls\n// {@link //reportUnwantedToken} to report the error, followed by\n// {@link Parser//consume} to actually \"delete\" the extraneous token. Then,\n// before returning {@link //reportMatch} is called to signal a successful\n// match.</p>\n//\n// @param recognizer the parser instance\n// @return the successfully matched {@link Token} instance if single-token\n// deletion successfully recovers from the mismatched input, otherwise\n// {@code null}\n//\nDefaultErrorStrategy.prototype.singleTokenDeletion = function(recognizer) {\n    var nextTokenType = recognizer.getTokenStream().LA(2);\n    var expecting = this.getExpectedTokens(recognizer);\n    if (expecting.contains(nextTokenType)) {\n        this.reportUnwantedToken(recognizer);\n        // print(\"recoverFromMismatchedToken deleting \" \\\n        // + str(recognizer.getTokenStream().LT(1)) \\\n        // + \" since \" + str(recognizer.getTokenStream().LT(2)) \\\n        // + \" is what we want\", file=sys.stderr)\n        recognizer.consume(); // simply delete extra token\n        // we want to return the token we're actually matching\n        var matchedSymbol = recognizer.getCurrentToken();\n        this.reportMatch(recognizer); // we know current token is correct\n        return matchedSymbol;\n    } else {\n        return null;\n    }\n};\n\n// Conjure up a missing token during error recovery.\n//\n// The recognizer attempts to recover from single missing\n// symbols. But, actions might refer to that missing symbol.\n// For example, x=ID {f($x);}. The action clearly assumes\n// that there has been an identifier matched previously and that\n// $x points at that token. If that token is missing, but\n// the next token in the stream is what we want we assume that\n// this token is missing and we keep going. Because we\n// have to return some token to replace the missing token,\n// we have to conjure one up. This method gives the user control\n// over the tokens returned for missing tokens. Mostly,\n// you will want to create something special for identifier\n// tokens. For literals such as '{' and ',', the default\n// action in the parser or tree parser works. It simply creates\n// a CommonToken of the appropriate type. The text will be the token.\n// If you change what tokens must be created by the lexer,\n// override this method to create the appropriate tokens.\n//\nDefaultErrorStrategy.prototype.getMissingSymbol = function(recognizer) {\n    var currentSymbol = recognizer.getCurrentToken();\n    var expecting = this.getExpectedTokens(recognizer);\n    var expectedTokenType = expecting.first(); // get any element\n    var tokenText;\n    if (expectedTokenType===Token.EOF) {\n        tokenText = \"<missing EOF>\";\n    } else {\n        tokenText = \"<missing \" + recognizer.literalNames[expectedTokenType] + \">\";\n    }\n    var current = currentSymbol;\n    var lookback = recognizer.getTokenStream().LT(-1);\n    if (current.type===Token.EOF && lookback !== null) {\n        current = lookback;\n    }\n    return recognizer.getTokenFactory().create(current.source,\n        expectedTokenType, tokenText, Token.DEFAULT_CHANNEL,\n        -1, -1, current.line, current.column);\n};\n\nDefaultErrorStrategy.prototype.getExpectedTokens = function(recognizer) {\n    return recognizer.getExpectedTokens();\n};\n\n// How should a token be displayed in an error message? The default\n// is to display just the text, but during development you might\n// want to have a lot of information spit out. Override in that case\n// to use t.toString() (which, for CommonToken, dumps everything about\n// the token). This is better than forcing you to override a method in\n// your token objects because you don't have to go modify your lexer\n// so that it creates a new Java type.\n//\nDefaultErrorStrategy.prototype.getTokenErrorDisplay = function(t) {\n    if (t === null) {\n        return \"<no token>\";\n    }\n    var s = t.text;\n    if (s === null) {\n        if (t.type===Token.EOF) {\n            s = \"<EOF>\";\n        } else {\n            s = \"<\" + t.type + \">\";\n        }\n    }\n    return this.escapeWSAndQuote(s);\n};\n\nDefaultErrorStrategy.prototype.escapeWSAndQuote = function(s) {\n    s = s.replace(/\\n/g,\"\\\\n\");\n    s = s.replace(/\\r/g,\"\\\\r\");\n    s = s.replace(/\\t/g,\"\\\\t\");\n    return \"'\" + s + \"'\";\n};\n\n// Compute the error recovery set for the current rule. During\n// rule invocation, the parser pushes the set of tokens that can\n// follow that rule reference on the stack; this amounts to\n// computing FIRST of what follows the rule reference in the\n// enclosing rule. See LinearApproximator.FIRST().\n// This local follow set only includes tokens\n// from within the rule; i.e., the FIRST computation done by\n// ANTLR stops at the end of a rule.\n//\n// EXAMPLE\n//\n// When you find a \"no viable alt exception\", the input is not\n// consistent with any of the alternatives for rule r. The best\n// thing to do is to consume tokens until you see something that\n// can legally follow a call to r//or* any rule that called r.\n// You don't want the exact set of viable next tokens because the\n// input might just be missing a token--you might consume the\n// rest of the input looking for one of the missing tokens.\n//\n// Consider grammar:\n//\n// a : '[' b ']'\n// | '(' b ')'\n// ;\n// b : c '^' INT ;\n// c : ID\n// | INT\n// ;\n//\n// At each rule invocation, the set of tokens that could follow\n// that rule is pushed on a stack. Here are the various\n// context-sensitive follow sets:\n//\n// FOLLOW(b1_in_a) = FIRST(']') = ']'\n// FOLLOW(b2_in_a) = FIRST(')') = ')'\n// FOLLOW(c_in_b) = FIRST('^') = '^'\n//\n// Upon erroneous input \"[]\", the call chain is\n//\n// a -> b -> c\n//\n// and, hence, the follow context stack is:\n//\n// depth follow set start of rule execution\n// 0 <EOF> a (from main())\n// 1 ']' b\n// 2 '^' c\n//\n// Notice that ')' is not included, because b would have to have\n// been called from a different context in rule a for ')' to be\n// included.\n//\n// For error recovery, we cannot consider FOLLOW(c)\n// (context-sensitive or otherwise). We need the combined set of\n// all context-sensitive FOLLOW sets--the set of all tokens that\n// could follow any reference in the call chain. We need to\n// resync to one of those tokens. Note that FOLLOW(c)='^' and if\n// we resync'd to that token, we'd consume until EOF. We need to\n// sync to context-sensitive FOLLOWs for a, b, and c: {']','^'}.\n// In this case, for input \"[]\", LA(1) is ']' and in the set, so we would\n// not consume anything. After printing an error, rule c would\n// return normally. Rule b would not find the required '^' though.\n// At this point, it gets a mismatched token error and throws an\n// exception (since LA(1) is not in the viable following token\n// set). The rule exception handler tries to recover, but finds\n// the same recovery set and doesn't consume anything. Rule b\n// exits normally returning to rule a. Now it finds the ']' (and\n// with the successful match exits errorRecovery mode).\n//\n// So, you can see that the parser walks up the call chain looking\n// for the token that was a member of the recovery set.\n//\n// Errors are not generated in errorRecovery mode.\n//\n// ANTLR's error recovery mechanism is based upon original ideas:\n//\n// \"Algorithms + Data Structures = Programs\" by Niklaus Wirth\n//\n// and\n//\n// \"A note on error recovery in recursive descent parsers\":\n// http://portal.acm.org/citation.cfm?id=947902.947905\n//\n// Later, Josef Grosch had some good ideas:\n//\n// \"Efficient and Comfortable Error Recovery in Recursive Descent\n// Parsers\":\n// ftp://www.cocolab.com/products/cocktail/doca4.ps/ell.ps.zip\n//\n// Like Grosch I implement context-sensitive FOLLOW sets that are combined\n// at run-time upon error to avoid overhead during parsing.\n//\nDefaultErrorStrategy.prototype.getErrorRecoverySet = function(recognizer) {\n    var atn = recognizer._interp.atn;\n    var ctx = recognizer._ctx;\n    var recoverSet = new IntervalSet();\n    while (ctx !== null && ctx.invokingState>=0) {\n        // compute what follows who invoked us\n        var invokingState = atn.states[ctx.invokingState];\n        var rt = invokingState.transitions[0];\n        var follow = atn.nextTokens(rt.followState);\n        recoverSet.addSet(follow);\n        ctx = ctx.parentCtx;\n    }\n    recoverSet.removeOne(Token.EPSILON);\n    return recoverSet;\n};\n\n// Consume tokens until one matches the given token set.//\nDefaultErrorStrategy.prototype.consumeUntil = function(recognizer, set) {\n    var ttype = recognizer.getTokenStream().LA(1);\n    while( ttype !== Token.EOF && !set.contains(ttype)) {\n        recognizer.consume();\n        ttype = recognizer.getTokenStream().LA(1);\n    }\n};\n\n//\n// This implementation of {@link ANTLRErrorStrategy} responds to syntax errors\n// by immediately canceling the parse operation with a\n// {@link ParseCancellationException}. The implementation ensures that the\n// {@link ParserRuleContext//exception} field is set for all parse tree nodes\n// that were not completed prior to encountering the error.\n//\n// <p>\n// This error strategy is useful in the following scenarios.</p>\n//\n// <ul>\n// <li><strong>Two-stage parsing:</strong> This error strategy allows the first\n// stage of two-stage parsing to immediately terminate if an error is\n// encountered, and immediately fall back to the second stage. In addition to\n// avoiding wasted work by attempting to recover from errors here, the empty\n// implementation of {@link BailErrorStrategy//sync} improves the performance of\n// the first stage.</li>\n// <li><strong>Silent validation:</strong> When syntax errors are not being\n// reported or logged, and the parse result is simply ignored if errors occur,\n// the {@link BailErrorStrategy} avoids wasting work on recovering from errors\n// when the result will be ignored either way.</li>\n// </ul>\n//\n// <p>\n// {@code myparser.setErrorHandler(new BailErrorStrategy());}</p>\n//\n// @see Parser//setErrorHandler(ANTLRErrorStrategy)\n//\nfunction BailErrorStrategy() {\n\tDefaultErrorStrategy.call(this);\n\treturn this;\n}\n\nBailErrorStrategy.prototype = Object.create(DefaultErrorStrategy.prototype);\nBailErrorStrategy.prototype.constructor = BailErrorStrategy;\n\n// Instead of recovering from exception {@code e}, re-throw it wrapped\n// in a {@link ParseCancellationException} so it is not caught by the\n// rule function catches. Use {@link Exception//getCause()} to get the\n// original {@link RecognitionException}.\n//\nBailErrorStrategy.prototype.recover = function(recognizer, e) {\n    var context = recognizer._ctx;\n    while (context !== null) {\n        context.exception = e;\n        context = context.parentCtx;\n    }\n    throw new ParseCancellationException(e);\n};\n\n// Make sure we don't attempt to recover inline; if the parser\n// successfully recovers, it won't throw an exception.\n//\nBailErrorStrategy.prototype.recoverInline = function(recognizer) {\n    this.recover(recognizer, new InputMismatchException(recognizer));\n};\n\n// Make sure we don't attempt to recover from problems in subrules.//\nBailErrorStrategy.prototype.sync = function(recognizer) {\n    // pass\n};\n\nexports.BailErrorStrategy = BailErrorStrategy;\nexports.DefaultErrorStrategy = DefaultErrorStrategy;\n","/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n\n// The root of the ANTLR exception hierarchy. In general, ANTLR tracks just\n//  3 kinds of errors: prediction errors, failed predicate errors, and\n//  mismatched input errors. In each case, the parser knows where it is\n//  in the input, where it is in the ATN, the rule invocation stack,\n//  and what kind of problem occurred.\n\nvar PredicateTransition = require('./../atn/Transition').PredicateTransition;\n\nfunction RecognitionException(params) {\n\tError.call(this);\n\tif (!!Error.captureStackTrace) {\n        Error.captureStackTrace(this, RecognitionException);\n\t} else {\n\t\tvar stack = new Error().stack;\n\t}\n\tthis.message = params.message;\n    this.recognizer = params.recognizer;\n    this.input = params.input;\n    this.ctx = params.ctx;\n    // The current {@link Token} when an error occurred. Since not all streams\n    // support accessing symbols by index, we have to track the {@link Token}\n    // instance itself.\n    this.offendingToken = null;\n    // Get the ATN state number the parser was in at the time the error\n    // occurred. For {@link NoViableAltException} and\n    // {@link LexerNoViableAltException} exceptions, this is the\n    // {@link DecisionState} number. For others, it is the state whose outgoing\n    // edge we couldn't match.\n    this.offendingState = -1;\n    if (this.recognizer!==null) {\n        this.offendingState = this.recognizer.state;\n    }\n    return this;\n}\n\nRecognitionException.prototype = Object.create(Error.prototype);\nRecognitionException.prototype.constructor = RecognitionException;\n\n// <p>If the state number is not known, this method returns -1.</p>\n\n//\n// Gets the set of input symbols which could potentially follow the\n// previously matched symbol at the time this exception was thrown.\n//\n// <p>If the set of expected tokens is not known and could not be computed,\n// this method returns {@code null}.</p>\n//\n// @return The set of token types that could potentially follow the current\n// state in the ATN, or {@code null} if the information is not available.\n// /\nRecognitionException.prototype.getExpectedTokens = function() {\n    if (this.recognizer!==null) {\n        return this.recognizer.atn.getExpectedTokens(this.offendingState, this.ctx);\n    } else {\n        return null;\n    }\n};\n\nRecognitionException.prototype.toString = function() {\n    return this.message;\n};\n\nfunction LexerNoViableAltException(lexer, input, startIndex, deadEndConfigs) {\n\tRecognitionException.call(this, {message:\"\", recognizer:lexer, input:input, ctx:null});\n    this.startIndex = startIndex;\n    this.deadEndConfigs = deadEndConfigs;\n    return this;\n}\n\nLexerNoViableAltException.prototype = Object.create(RecognitionException.prototype);\nLexerNoViableAltException.prototype.constructor = LexerNoViableAltException;\n\nLexerNoViableAltException.prototype.toString = function() {\n    var symbol = \"\";\n    if (this.startIndex >= 0 && this.startIndex < this.input.size) {\n        symbol = this.input.getText((this.startIndex,this.startIndex));\n    }\n    return \"LexerNoViableAltException\" + symbol;\n};\n\n// Indicates that the parser could not decide which of two or more paths\n// to take based upon the remaining input. It tracks the starting token\n// of the offending input and also knows where the parser was\n// in the various paths when the error. Reported by reportNoViableAlternative()\n//\nfunction NoViableAltException(recognizer, input, startToken, offendingToken, deadEndConfigs, ctx) {\n\tctx = ctx || recognizer._ctx;\n\toffendingToken = offendingToken || recognizer.getCurrentToken();\n\tstartToken = startToken || recognizer.getCurrentToken();\n\tinput = input || recognizer.getInputStream();\n\tRecognitionException.call(this, {message:\"\", recognizer:recognizer, input:input, ctx:ctx});\n    // Which configurations did we try at input.index() that couldn't match\n\t// input.LT(1)?//\n    this.deadEndConfigs = deadEndConfigs;\n    // The token object at the start index; the input stream might\n    // not be buffering tokens so get a reference to it. (At the\n    // time the error occurred, of course the stream needs to keep a\n    // buffer all of the tokens but later we might not have access to those.)\n    this.startToken = startToken;\n    this.offendingToken = offendingToken;\n}\n\nNoViableAltException.prototype = Object.create(RecognitionException.prototype);\nNoViableAltException.prototype.constructor = NoViableAltException;\n\n// This signifies any kind of mismatched input exceptions such as\n// when the current input does not match the expected token.\n//\nfunction InputMismatchException(recognizer) {\n\tRecognitionException.call(this, {message:\"\", recognizer:recognizer, input:recognizer.getInputStream(), ctx:recognizer._ctx});\n    this.offendingToken = recognizer.getCurrentToken();\n}\n\nInputMismatchException.prototype = Object.create(RecognitionException.prototype);\nInputMismatchException.prototype.constructor = InputMismatchException;\n\n// A semantic predicate failed during validation. Validation of predicates\n// occurs when normally parsing the alternative just like matching a token.\n// Disambiguating predicate evaluation occurs when we test a predicate during\n// prediction.\n\nfunction FailedPredicateException(recognizer, predicate, message) {\n\tRecognitionException.call(this, {message:this.formatMessage(predicate,message || null), recognizer:recognizer,\n                         input:recognizer.getInputStream(), ctx:recognizer._ctx});\n    var s = recognizer._interp.atn.states[recognizer.state];\n    var trans = s.transitions[0];\n    if (trans instanceof PredicateTransition) {\n        this.ruleIndex = trans.ruleIndex;\n        this.predicateIndex = trans.predIndex;\n    } else {\n        this.ruleIndex = 0;\n        this.predicateIndex = 0;\n    }\n    this.predicate = predicate;\n    this.offendingToken = recognizer.getCurrentToken();\n    return this;\n}\n\nFailedPredicateException.prototype = Object.create(RecognitionException.prototype);\nFailedPredicateException.prototype.constructor = FailedPredicateException;\n\nFailedPredicateException.prototype.formatMessage = function(predicate, message) {\n    if (message !==null) {\n        return message;\n    } else {\n        return \"failed predicate: {\" + predicate + \"}?\";\n    }\n};\n\nfunction ParseCancellationException() {\n\tError.call(this);\n\tError.captureStackTrace(this, ParseCancellationException);\n\treturn this;\n}\n\nParseCancellationException.prototype = Object.create(Error.prototype);\nParseCancellationException.prototype.constructor = ParseCancellationException;\n\nexports.RecognitionException = RecognitionException;\nexports.NoViableAltException = NoViableAltException;\nexports.LexerNoViableAltException = LexerNoViableAltException;\nexports.InputMismatchException = InputMismatchException;\nexports.FailedPredicateException = FailedPredicateException;\nexports.ParseCancellationException = ParseCancellationException;\n","/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n\nexports.RecognitionException = require('./Errors').RecognitionException;\nexports.NoViableAltException = require('./Errors').NoViableAltException;\nexports.LexerNoViableAltException = require('./Errors').LexerNoViableAltException;\nexports.InputMismatchException = require('./Errors').InputMismatchException;\nexports.FailedPredicateException = require('./Errors').FailedPredicateException;\nexports.DiagnosticErrorListener = require('./DiagnosticErrorListener').DiagnosticErrorListener;\nexports.BailErrorStrategy = require('./ErrorStrategy').BailErrorStrategy;\nexports.ErrorListener = require('./ErrorListener').ErrorListener;\n","/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nexports.atn = require('./atn/index');\nexports.codepointat = require('./polyfills/codepointat');\nexports.dfa = require('./dfa/index');\nexports.fromcodepoint = require('./polyfills/fromcodepoint');\nexports.tree = require('./tree/index');\nexports.error = require('./error/index');\nexports.Token = require('./Token').Token;\nexports.CharStreams = require('./CharStreams').CharStreams;\nexports.CommonToken = require('./Token').CommonToken;\nexports.InputStream = require('./InputStream').InputStream;\nexports.FileStream = require('./FileStream').FileStream;\nexports.CommonTokenStream = require('./CommonTokenStream').CommonTokenStream;\nexports.Lexer = require('./Lexer').Lexer;\nexports.Parser = require('./Parser').Parser;\nvar pc = require('./PredictionContext');\nexports.PredictionContextCache = pc.PredictionContextCache;\nexports.ParserRuleContext = require('./ParserRuleContext').ParserRuleContext;\nexports.Interval = require('./IntervalSet').Interval;\nexports.Utils = require('./Utils');\n","/*! https://mths.be/codepointat v0.2.0 by @mathias */\nif (!String.prototype.codePointAt) {\n\t(function() {\n\t\t'use strict'; // needed to support `apply`/`call` with `undefined`/`null`\n\t\tvar defineProperty = (function() {\n\t\t\t// IE 8 only supports `Object.defineProperty` on DOM elements\n\t\t\ttry {\n\t\t\t\tvar object = {};\n\t\t\t\tvar $defineProperty = Object.defineProperty;\n\t\t\t\tvar result = $defineProperty(object, object, object) && $defineProperty;\n\t\t\t} catch(error) {}\n\t\t\treturn result;\n\t\t}());\n\t\tvar codePointAt = function(position) {\n\t\t\tif (this == null) {\n\t\t\t\tthrow TypeError();\n\t\t\t}\n\t\t\tvar string = String(this);\n\t\t\tvar size = string.length;\n\t\t\t// `ToInteger`\n\t\t\tvar index = position ? Number(position) : 0;\n\t\t\tif (index != index) { // better `isNaN`\n\t\t\t\tindex = 0;\n\t\t\t}\n\t\t\t// Account for out-of-bounds indices:\n\t\t\tif (index < 0 || index >= size) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\t// Get the first code unit\n\t\t\tvar first = string.charCodeAt(index);\n\t\t\tvar second;\n\t\t\tif ( // check if it’s the start of a surrogate pair\n\t\t\t\tfirst >= 0xD800 && first <= 0xDBFF && // high surrogate\n\t\t\t\tsize > index + 1 // there is a next code unit\n\t\t\t) {\n\t\t\t\tsecond = string.charCodeAt(index + 1);\n\t\t\t\tif (second >= 0xDC00 && second <= 0xDFFF) { // low surrogate\n\t\t\t\t\t// https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n\t\t\t\t\treturn (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn first;\n\t\t};\n\t\tif (defineProperty) {\n\t\t\tdefineProperty(String.prototype, 'codePointAt', {\n\t\t\t\t'value': codePointAt,\n\t\t\t\t'configurable': true,\n\t\t\t\t'writable': true\n\t\t\t});\n\t\t} else {\n\t\t\tString.prototype.codePointAt = codePointAt;\n\t\t}\n\t}());\n}\n","/*! https://mths.be/fromcodepoint v0.2.1 by @mathias */\nif (!String.fromCodePoint) {\n\t(function() {\n\t\tvar defineProperty = (function() {\n\t\t\t// IE 8 only supports `Object.defineProperty` on DOM elements\n\t\t\ttry {\n\t\t\t\tvar object = {};\n\t\t\t\tvar $defineProperty = Object.defineProperty;\n\t\t\t\tvar result = $defineProperty(object, object, object) && $defineProperty;\n\t\t\t} catch(error) {}\n\t\t\treturn result;\n\t\t}());\n\t\tvar stringFromCharCode = String.fromCharCode;\n\t\tvar floor = Math.floor;\n\t\tvar fromCodePoint = function(_) {\n\t\t\tvar MAX_SIZE = 0x4000;\n\t\t\tvar codeUnits = [];\n\t\t\tvar highSurrogate;\n\t\t\tvar lowSurrogate;\n\t\t\tvar index = -1;\n\t\t\tvar length = arguments.length;\n\t\t\tif (!length) {\n\t\t\t\treturn '';\n\t\t\t}\n\t\t\tvar result = '';\n\t\t\twhile (++index < length) {\n\t\t\t\tvar codePoint = Number(arguments[index]);\n\t\t\t\tif (\n\t\t\t\t\t!isFinite(codePoint) || // `NaN`, `+Infinity`, or `-Infinity`\n\t\t\t\t\tcodePoint < 0 || // not a valid Unicode code point\n\t\t\t\t\tcodePoint > 0x10FFFF || // not a valid Unicode code point\n\t\t\t\t\tfloor(codePoint) != codePoint // not an integer\n\t\t\t\t) {\n\t\t\t\t\tthrow RangeError('Invalid code point: ' + codePoint);\n\t\t\t\t}\n\t\t\t\tif (codePoint <= 0xFFFF) { // BMP code point\n\t\t\t\t\tcodeUnits.push(codePoint);\n\t\t\t\t} else { // Astral code point; split in surrogate halves\n\t\t\t\t\t// https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n\t\t\t\t\tcodePoint -= 0x10000;\n\t\t\t\t\thighSurrogate = (codePoint >> 10) + 0xD800;\n\t\t\t\t\tlowSurrogate = (codePoint % 0x400) + 0xDC00;\n\t\t\t\t\tcodeUnits.push(highSurrogate, lowSurrogate);\n\t\t\t\t}\n\t\t\t\tif (index + 1 == length || codeUnits.length > MAX_SIZE) {\n\t\t\t\t\tresult += stringFromCharCode.apply(null, codeUnits);\n\t\t\t\t\tcodeUnits.length = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result;\n\t\t};\n\t\tif (defineProperty) {\n\t\t\tdefineProperty(String, 'fromCodePoint', {\n\t\t\t\t'value': fromCodePoint,\n\t\t\t\t'configurable': true,\n\t\t\t\t'writable': true\n\t\t\t});\n\t\t} else {\n\t\t\tString.fromCodePoint = fromCodePoint;\n\t\t}\n\t}());\n}\n","/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n///\n\n// The basic notion of a tree has a parent, a payload, and a list of children.\n//  It is the most abstract interface for all the trees used by ANTLR.\n///\n\nvar Token = require('./../Token').Token;\nvar Interval = require('./../IntervalSet').Interval;\nvar INVALID_INTERVAL = new Interval(-1, -2);\nvar Utils = require('../Utils.js');\n\n\nfunction Tree() {\n\treturn this;\n}\n\nfunction SyntaxTree() {\n\tTree.call(this);\n\treturn this;\n}\n\nSyntaxTree.prototype = Object.create(Tree.prototype);\nSyntaxTree.prototype.constructor = SyntaxTree;\n\nfunction ParseTree() {\n\tSyntaxTree.call(this);\n\treturn this;\n}\n\nParseTree.prototype = Object.create(SyntaxTree.prototype);\nParseTree.prototype.constructor = ParseTree;\n\nfunction RuleNode() {\n\tParseTree.call(this);\n\treturn this;\n}\n\nRuleNode.prototype = Object.create(ParseTree.prototype);\nRuleNode.prototype.constructor = RuleNode;\n\nfunction TerminalNode() {\n\tParseTree.call(this);\n\treturn this;\n}\n\nTerminalNode.prototype = Object.create(ParseTree.prototype);\nTerminalNode.prototype.constructor = TerminalNode;\n\nfunction ErrorNode() {\n\tTerminalNode.call(this);\n\treturn this;\n}\n\nErrorNode.prototype = Object.create(TerminalNode.prototype);\nErrorNode.prototype.constructor = ErrorNode;\n\nfunction ParseTreeVisitor() {\n\treturn this;\n}\n\nParseTreeVisitor.prototype.visit = function(ctx) {\n \tif (Array.isArray(ctx)) {\n\t\treturn ctx.map(function(child) {\n            return child.accept(this);\n        }, this);\n\t} else {\n\t\treturn ctx.accept(this);\n\t}\n};\n\nParseTreeVisitor.prototype.visitChildren = function(ctx) {\n  return this.visit(ctx.children);\n}\n\nParseTreeVisitor.prototype.visitTerminal = function(node) {\n};\n\nParseTreeVisitor.prototype.visitErrorNode = function(node) {\n};\n\n\nfunction ParseTreeListener() {\n\treturn this;\n}\n\nParseTreeListener.prototype.visitTerminal = function(node) {\n};\n\nParseTreeListener.prototype.visitErrorNode = function(node) {\n};\n\nParseTreeListener.prototype.enterEveryRule = function(node) {\n};\n\nParseTreeListener.prototype.exitEveryRule = function(node) {\n};\n\nfunction TerminalNodeImpl(symbol) {\n\tTerminalNode.call(this);\n\tthis.parentCtx = null;\n\tthis.symbol = symbol;\n\treturn this;\n}\n\nTerminalNodeImpl.prototype = Object.create(TerminalNode.prototype);\nTerminalNodeImpl.prototype.constructor = TerminalNodeImpl;\n\nTerminalNodeImpl.prototype.getChild = function(i) {\n\treturn null;\n};\n\nTerminalNodeImpl.prototype.getSymbol = function() {\n\treturn this.symbol;\n};\n\nTerminalNodeImpl.prototype.getParent = function() {\n\treturn this.parentCtx;\n};\n\nTerminalNodeImpl.prototype.getPayload = function() {\n\treturn this.symbol;\n};\n\nTerminalNodeImpl.prototype.getSourceInterval = function() {\n\tif (this.symbol === null) {\n\t\treturn INVALID_INTERVAL;\n\t}\n\tvar tokenIndex = this.symbol.tokenIndex;\n\treturn new Interval(tokenIndex, tokenIndex);\n};\n\nTerminalNodeImpl.prototype.getChildCount = function() {\n\treturn 0;\n};\n\nTerminalNodeImpl.prototype.accept = function(visitor) {\n\treturn visitor.visitTerminal(this);\n};\n\nTerminalNodeImpl.prototype.getText = function() {\n\treturn this.symbol.text;\n};\n\nTerminalNodeImpl.prototype.toString = function() {\n\tif (this.symbol.type === Token.EOF) {\n\t\treturn \"<EOF>\";\n\t} else {\n\t\treturn this.symbol.text;\n\t}\n};\n\n// Represents a token that was consumed during resynchronization\n// rather than during a valid match operation. For example,\n// we will create this kind of a node during single token insertion\n// and deletion as well as during \"consume until error recovery set\"\n// upon no viable alternative exceptions.\n\nfunction ErrorNodeImpl(token) {\n\tTerminalNodeImpl.call(this, token);\n\treturn this;\n}\n\nErrorNodeImpl.prototype = Object.create(TerminalNodeImpl.prototype);\nErrorNodeImpl.prototype.constructor = ErrorNodeImpl;\n\nErrorNodeImpl.prototype.isErrorNode = function() {\n\treturn true;\n};\n\nErrorNodeImpl.prototype.accept = function(visitor) {\n\treturn visitor.visitErrorNode(this);\n};\n\nfunction ParseTreeWalker() {\n\treturn this;\n}\n\nParseTreeWalker.prototype.walk = function(listener, t) {\n\tvar errorNode = t instanceof ErrorNode ||\n\t\t\t(t.isErrorNode !== undefined && t.isErrorNode());\n\tif (errorNode) {\n\t\tlistener.visitErrorNode(t);\n\t} else if (t instanceof TerminalNode) {\n\t\tlistener.visitTerminal(t);\n\t} else {\n\t\tthis.enterRule(listener, t);\n\t\tfor (var i = 0; i < t.getChildCount(); i++) {\n\t\t\tvar child = t.getChild(i);\n\t\t\tthis.walk(listener, child);\n\t\t}\n\t\tthis.exitRule(listener, t);\n\t}\n};\n//\n// The discovery of a rule node, involves sending two events: the generic\n// {@link ParseTreeListener//enterEveryRule} and a\n// {@link RuleContext}-specific event. First we trigger the generic and then\n// the rule specific. We to them in reverse order upon finishing the node.\n//\nParseTreeWalker.prototype.enterRule = function(listener, r) {\n\tvar ctx = r.getRuleContext();\n\tlistener.enterEveryRule(ctx);\n\tctx.enterRule(listener);\n};\n\nParseTreeWalker.prototype.exitRule = function(listener, r) {\n\tvar ctx = r.getRuleContext();\n\tctx.exitRule(listener);\n\tlistener.exitEveryRule(ctx);\n};\n\nParseTreeWalker.DEFAULT = new ParseTreeWalker();\n\nexports.RuleNode = RuleNode;\nexports.ErrorNode = ErrorNode;\nexports.TerminalNode = TerminalNode;\nexports.ErrorNodeImpl = ErrorNodeImpl;\nexports.TerminalNodeImpl = TerminalNodeImpl;\nexports.ParseTreeListener = ParseTreeListener;\nexports.ParseTreeVisitor = ParseTreeVisitor;\nexports.ParseTreeWalker = ParseTreeWalker;\nexports.INVALID_INTERVAL = INVALID_INTERVAL;\n","/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n\nvar Utils = require('./../Utils');\nvar Token = require('./../Token').Token;\nvar RuleNode = require('./Tree').RuleNode;\nvar ErrorNode = require('./Tree').ErrorNode;\nvar TerminalNode = require('./Tree').TerminalNode;\nvar ParserRuleContext = require('./../ParserRuleContext').ParserRuleContext;\nvar RuleContext = require('./../RuleContext').RuleContext;\nvar INVALID_ALT_NUMBER = require('./../atn/ATN').INVALID_ALT_NUMBER;\n\n\n/** A set of utility routines useful for all kinds of ANTLR trees. */\nfunction Trees() {\n}\n\n// Print out a whole tree in LISP form. {@link //getNodeText} is used on the\n//  node payloads to get the text for the nodes.  Detect\n//  parse trees and extract data appropriately.\nTrees.toStringTree = function(tree, ruleNames, recog) {\n\truleNames = ruleNames || null;\n\trecog = recog || null;\n    if(recog!==null) {\n       ruleNames = recog.ruleNames;\n    }\n    var s = Trees.getNodeText(tree, ruleNames);\n    s = Utils.escapeWhitespace(s, false);\n    var c = tree.getChildCount();\n    if(c===0) {\n        return s;\n    }\n    var res = \"(\" + s + ' ';\n    if(c>0) {\n        s = Trees.toStringTree(tree.getChild(0), ruleNames);\n        res = res.concat(s);\n    }\n    for(var i=1;i<c;i++) {\n        s = Trees.toStringTree(tree.getChild(i), ruleNames);\n        res = res.concat(' ' + s);\n    }\n    res = res.concat(\")\");\n    return res;\n};\n\nTrees.getNodeText = function(t, ruleNames, recog) {\n\truleNames = ruleNames || null;\n\trecog = recog || null;\n    if(recog!==null) {\n        ruleNames = recog.ruleNames;\n    }\n    if(ruleNames!==null) {\n       if (t instanceof RuleContext) {\n           var altNumber = t.getAltNumber();\n           if ( altNumber!=INVALID_ALT_NUMBER ) {\n               return ruleNames[t.ruleIndex]+\":\"+altNumber;\n           }\n           return ruleNames[t.ruleIndex];\n       } else if ( t instanceof ErrorNode) {\n           return t.toString();\n       } else if(t instanceof TerminalNode) {\n           if(t.symbol!==null) {\n               return t.symbol.text;\n           }\n       }\n    }\n    // no recog for rule names\n    var payload = t.getPayload();\n    if (payload instanceof Token ) {\n       return payload.text;\n    }\n    return t.getPayload().toString();\n};\n\n\n// Return ordered list of all children of this node\nTrees.getChildren = function(t) {\n\tvar list = [];\n\tfor(var i=0;i<t.getChildCount();i++) {\n\t\tlist.push(t.getChild(i));\n\t}\n\treturn list;\n};\n\n// Return a list of all ancestors of this node.  The first node of\n//  list is the root and the last is the parent of this node.\n//\nTrees.getAncestors = function(t) {\n    var ancestors = [];\n    t = t.getParent();\n    while(t!==null) {\n        ancestors = [t].concat(ancestors);\n        t = t.getParent();\n    }\n    return ancestors;\n};\n\nTrees.findAllTokenNodes = function(t, ttype) {\n    return Trees.findAllNodes(t, ttype, true);\n};\n\nTrees.findAllRuleNodes = function(t, ruleIndex) {\n\treturn Trees.findAllNodes(t, ruleIndex, false);\n};\n\nTrees.findAllNodes = function(t, index, findTokens) {\n\tvar nodes = [];\n\tTrees._findAllNodes(t, index, findTokens, nodes);\n\treturn nodes;\n};\n\nTrees._findAllNodes = function(t, index, findTokens, nodes) {\n\t// check this node (the root) first\n\tif(findTokens && (t instanceof TerminalNode)) {\n\t\tif(t.symbol.type===index) {\n\t\t\tnodes.push(t);\n\t\t}\n\t} else if(!findTokens && (t instanceof ParserRuleContext)) {\n\t\tif(t.ruleIndex===index) {\n\t\t\tnodes.push(t);\n\t\t}\n\t}\n\t// check children\n\tfor(var i=0;i<t.getChildCount();i++) {\n\t\tTrees._findAllNodes(t.getChild(i), index, findTokens, nodes);\n\t}\n};\n\nTrees.descendants = function(t) {\n\tvar nodes = [t];\n    for(var i=0;i<t.getChildCount();i++) {\n        nodes = nodes.concat(Trees.descendants(t.getChild(i)));\n    }\n    return nodes;\n};\n\n\nexports.Trees = Trees;","/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n\nvar Tree = require('./Tree');\nexports.Trees = require('./Trees').Trees;\nexports.RuleNode = Tree.RuleNode;\nexports.ParseTreeListener = Tree.ParseTreeListener;\nexports.ParseTreeVisitor = Tree.ParseTreeVisitor;\nexports.ParseTreeWalker = Tree.ParseTreeWalker;\n","// Generated from Sketch.g4 by ANTLR 4.7.1\r\n// jshint ignore: start\r\nvar antlr4 = require('antlr4/index');\r\n\r\n\r\nvar serializedATN = [\"\\u0003\\u608b\\ua72a\\u8133\\ub9ed\\u417c\\u3be7\\u7786\\u5964\",\r\n    \"\\u0002\\u0012q\\b\\u0001\\u0004\\u0002\\t\\u0002\\u0004\\u0003\\t\\u0003\\u0004\",\r\n    \"\\u0004\\t\\u0004\\u0004\\u0005\\t\\u0005\\u0004\\u0006\\t\\u0006\\u0004\\u0007\\t\",\r\n    \"\\u0007\\u0004\\b\\t\\b\\u0004\\t\\t\\t\\u0004\\n\\t\\n\\u0004\\u000b\\t\\u000b\\u0004\",\r\n    \"\\f\\t\\f\\u0004\\r\\t\\r\\u0004\\u000e\\t\\u000e\\u0004\\u000f\\t\\u000f\\u0004\\u0010\",\r\n    \"\\t\\u0010\\u0004\\u0011\\t\\u0011\\u0004\\u0012\\t\\u0012\\u0004\\u0013\\t\\u0013\",\r\n    \"\\u0004\\u0014\\t\\u0014\\u0003\\u0002\\u0003\\u0002\\u0003\\u0003\\u0003\\u0003\",\r\n    \"\\u0003\\u0004\\u0003\\u0004\\u0003\\u0005\\u0003\\u0005\\u0003\\u0006\\u0003\\u0006\",\r\n    \"\\u0003\\u0007\\u0003\\u0007\\u0003\\b\\u0003\\b\\u0003\\t\\u0003\\t\\u0003\\t\\u0006\",\r\n    \"\\t;\\n\\t\\r\\t\\u000e\\t<\\u0003\\n\\u0003\\n\\u0005\\nA\\n\\n\\u0003\\n\\u0003\\n\\u0005\",\r\n    \"\\nE\\n\\n\\u0003\\n\\u0003\\n\\u0003\\u000b\\u0005\\u000bJ\\n\\u000b\\u0003\\u000b\",\r\n    \"\\u0006\\u000bM\\n\\u000b\\r\\u000b\\u000e\\u000bN\\u0003\\u000b\\u0003\\u000b\\u0006\",\r\n    \"\\u000bS\\n\\u000b\\r\\u000b\\u000e\\u000bT\\u0005\\u000bW\\n\\u000b\\u0003\\f\\u0003\",\r\n    \"\\f\\u0003\\r\\u0003\\r\\u0003\\u000e\\u0003\\u000e\\u0003\\u000f\\u0003\\u000f\\u0003\",\r\n    \"\\u0010\\u0003\\u0010\\u0003\\u0011\\u0003\\u0011\\u0003\\u0012\\u0003\\u0012\\u0003\",\r\n    \"\\u0013\\u0003\\u0013\\u0003\\u0014\\u0003\\u0014\\u0007\\u0014k\\n\\u0014\\f\\u0014\",\r\n    \"\\u000e\\u0014n\\u000b\\u0014\\u0003\\u0014\\u0003\\u0014\\u0003l\\u0002\\u0015\",\r\n    \"\\u0003\\u0002\\u0005\\u0002\\u0007\\u0002\\t\\u0003\\u000b\\u0004\\r\\u0005\\u000f\",\r\n    \"\\u0006\\u0011\\u0007\\u0013\\b\\u0015\\t\\u0017\\n\\u0019\\u000b\\u001b\\f\\u001d\",\r\n    \"\\r\\u001f\\u000e!\\u000f#\\u0010%\\u0011\\'\\u0012\\u0003\\u0002\\n\\u0003\\u0002\",\r\n    \"c|\\u0003\\u0002C\\\\\\u0003\\u00022;\\u0006\\u0002GGPPUUYY\\u0006\\u0002FFNN\",\r\n    \"TTWW\\u0003\\u0002HI\\u0004\\u0002\\u000b\\u000b\\\"\\\"\\u0003\\u000200\\u0002x\",\r\n    \"\\u0002\\t\\u0003\\u0002\\u0002\\u0002\\u0002\\u000b\\u0003\\u0002\\u0002\\u0002\",\r\n    \"\\u0002\\r\\u0003\\u0002\\u0002\\u0002\\u0002\\u000f\\u0003\\u0002\\u0002\\u0002\",\r\n    \"\\u0002\\u0011\\u0003\\u0002\\u0002\\u0002\\u0002\\u0013\\u0003\\u0002\\u0002\\u0002\",\r\n    \"\\u0002\\u0015\\u0003\\u0002\\u0002\\u0002\\u0002\\u0017\\u0003\\u0002\\u0002\\u0002\",\r\n    \"\\u0002\\u0019\\u0003\\u0002\\u0002\\u0002\\u0002\\u001b\\u0003\\u0002\\u0002\\u0002\",\r\n    \"\\u0002\\u001d\\u0003\\u0002\\u0002\\u0002\\u0002\\u001f\\u0003\\u0002\\u0002\\u0002\",\r\n    \"\\u0002!\\u0003\\u0002\\u0002\\u0002\\u0002#\\u0003\\u0002\\u0002\\u0002\\u0002\",\r\n    \"%\\u0003\\u0002\\u0002\\u0002\\u0002\\'\\u0003\\u0002\\u0002\\u0002\\u0003)\\u0003\",\r\n    \"\\u0002\\u0002\\u0002\\u0005+\\u0003\\u0002\\u0002\\u0002\\u0007-\\u0003\\u0002\",\r\n    \"\\u0002\\u0002\\t/\\u0003\\u0002\\u0002\\u0002\\u000b1\\u0003\\u0002\\u0002\\u0002\",\r\n    \"\\r3\\u0003\\u0002\\u0002\\u0002\\u000f5\\u0003\\u0002\\u0002\\u0002\\u0011:\\u0003\",\r\n    \"\\u0002\\u0002\\u0002\\u0013D\\u0003\\u0002\\u0002\\u0002\\u0015I\\u0003\\u0002\",\r\n    \"\\u0002\\u0002\\u0017X\\u0003\\u0002\\u0002\\u0002\\u0019Z\\u0003\\u0002\\u0002\",\r\n    \"\\u0002\\u001b\\\\\\u0003\\u0002\\u0002\\u0002\\u001d^\\u0003\\u0002\\u0002\\u0002\",\r\n    \"\\u001f`\\u0003\\u0002\\u0002\\u0002!b\\u0003\\u0002\\u0002\\u0002#d\\u0003\\u0002\",\r\n    \"\\u0002\\u0002%f\\u0003\\u0002\\u0002\\u0002\\'h\\u0003\\u0002\\u0002\\u0002)*\",\r\n    \"\\t\\u0002\\u0002\\u0002*\\u0004\\u0003\\u0002\\u0002\\u0002+,\\t\\u0003\\u0002\",\r\n    \"\\u0002,\\u0006\\u0003\\u0002\\u0002\\u0002-.\\t\\u0004\\u0002\\u0002.\\b\\u0003\",\r\n    \"\\u0002\\u0002\\u0002/0\\t\\u0005\\u0002\\u00020\\n\\u0003\\u0002\\u0002\\u0002\",\r\n    \"12\\t\\u0006\\u0002\\u00022\\f\\u0003\\u0002\\u0002\\u000234\\t\\u0007\\u0002\\u0002\",\r\n    \"4\\u000e\\u0003\\u0002\\u0002\\u000256\\u0007?\\u0002\\u00026\\u0010\\u0003\\u0002\",\r\n    \"\\u0002\\u00027;\\u0005\\u0003\\u0002\\u00028;\\u0005\\u0005\\u0003\\u00029;\\u0007\",\r\n    \"a\\u0002\\u0002:7\\u0003\\u0002\\u0002\\u0002:8\\u0003\\u0002\\u0002\\u0002:9\",\r\n    \"\\u0003\\u0002\\u0002\\u0002;<\\u0003\\u0002\\u0002\\u0002<:\\u0003\\u0002\\u0002\",\r\n    \"\\u0002<=\\u0003\\u0002\\u0002\\u0002=\\u0012\\u0003\\u0002\\u0002\\u0002>E\\t\",\r\n    \"\\b\\u0002\\u0002?A\\u0007\\u000f\\u0002\\u0002@?\\u0003\\u0002\\u0002\\u0002@\",\r\n    \"A\\u0003\\u0002\\u0002\\u0002AB\\u0003\\u0002\\u0002\\u0002BE\\u0007\\f\\u0002\",\r\n    \"\\u0002CE\\u0007\\u000f\\u0002\\u0002D>\\u0003\\u0002\\u0002\\u0002D@\\u0003\\u0002\",\r\n    \"\\u0002\\u0002DC\\u0003\\u0002\\u0002\\u0002EF\\u0003\\u0002\\u0002\\u0002FG\\b\",\r\n    \"\\n\\u0002\\u0002G\\u0014\\u0003\\u0002\\u0002\\u0002HJ\\u0007/\\u0002\\u0002I\",\r\n    \"H\\u0003\\u0002\\u0002\\u0002IJ\\u0003\\u0002\\u0002\\u0002JL\\u0003\\u0002\\u0002\",\r\n    \"\\u0002KM\\u0005\\u0007\\u0004\\u0002LK\\u0003\\u0002\\u0002\\u0002MN\\u0003\\u0002\",\r\n    \"\\u0002\\u0002NL\\u0003\\u0002\\u0002\\u0002NO\\u0003\\u0002\\u0002\\u0002OV\\u0003\",\r\n    \"\\u0002\\u0002\\u0002PR\\t\\t\\u0002\\u0002QS\\u0005\\u0007\\u0004\\u0002RQ\\u0003\",\r\n    \"\\u0002\\u0002\\u0002ST\\u0003\\u0002\\u0002\\u0002TR\\u0003\\u0002\\u0002\\u0002\",\r\n    \"TU\\u0003\\u0002\\u0002\\u0002UW\\u0003\\u0002\\u0002\\u0002VP\\u0003\\u0002\\u0002\",\r\n    \"\\u0002VW\\u0003\\u0002\\u0002\\u0002W\\u0016\\u0003\\u0002\\u0002\\u0002XY\\u0007\",\r\n    \"]\\u0002\\u0002Y\\u0018\\u0003\\u0002\\u0002\\u0002Z[\\u0007_\\u0002\\u0002[\\u001a\",\r\n    \"\\u0003\\u0002\\u0002\\u0002\\\\]\\u0007=\\u0002\\u0002]\\u001c\\u0003\\u0002\\u0002\",\r\n    \"\\u0002^_\\u0007<\\u0002\\u0002_\\u001e\\u0003\\u0002\\u0002\\u0002`a\\u0007.\",\r\n    \"\\u0002\\u0002a \\u0003\\u0002\\u0002\\u0002bc\\u0007&\\u0002\\u0002c\\\"\\u0003\",\r\n    \"\\u0002\\u0002\\u0002de\\u00070\\u0002\\u0002e$\\u0003\\u0002\\u0002\\u0002fg\",\r\n    \"\\u0007,\\u0002\\u0002g&\\u0003\\u0002\\u0002\\u0002hl\\u0007}\\u0002\\u0002i\",\r\n    \"k\\u000b\\u0002\\u0002\\u0002ji\\u0003\\u0002\\u0002\\u0002kn\\u0003\\u0002\\u0002\",\r\n    \"\\u0002lm\\u0003\\u0002\\u0002\\u0002lj\\u0003\\u0002\\u0002\\u0002mo\\u0003\\u0002\",\r\n    \"\\u0002\\u0002nl\\u0003\\u0002\\u0002\\u0002op\\u0007\\u007f\\u0002\\u0002p(\\u0003\",\r\n    \"\\u0002\\u0002\\u0002\\f\\u0002:<@DINTVl\\u0003\\b\\u0002\\u0002\"].join(\"\");\r\n\r\n\r\nvar atn = new antlr4.atn.ATNDeserializer().deserialize(serializedATN);\r\n\r\nvar decisionsToDFA = atn.decisionToState.map( function(ds, index) { return new antlr4.dfa.DFA(ds, index); });\r\n\r\nfunction SketchLexer(input) {\r\n\tantlr4.Lexer.call(this, input);\r\n    this._interp = new antlr4.atn.LexerATNSimulator(this, atn, decisionsToDFA, new antlr4.PredictionContextCache());\r\n    return this;\r\n}\r\n\r\nSketchLexer.prototype = Object.create(antlr4.Lexer.prototype);\r\nSketchLexer.prototype.constructor = SketchLexer;\r\n\r\nObject.defineProperty(SketchLexer.prototype, \"atn\", {\r\n        get : function() {\r\n                return atn;\r\n        }\r\n});\r\n\r\nSketchLexer.EOF = antlr4.Token.EOF;\r\nSketchLexer.DIRECTION = 1;\r\nSketchLexer.PARTIAL_DIRECTION = 2;\r\nSketchLexer.CURVATURE = 3;\r\nSketchLexer.EQUAL = 4;\r\nSketchLexer.WORD = 5;\r\nSketchLexer.WHITESPACE = 6;\r\nSketchLexer.NUMBER = 7;\r\nSketchLexer.START_DATA = 8;\r\nSketchLexer.END_DATA = 9;\r\nSketchLexer.SEMICOLON = 10;\r\nSketchLexer.COLON = 11;\r\nSketchLexer.COMMA = 12;\r\nSketchLexer.END_AREA = 13;\r\nSketchLexer.END = 14;\r\nSketchLexer.STAR = 15;\r\nSketchLexer.LABEL = 16;\r\n\r\nSketchLexer.prototype.channelNames = [ \"DEFAULT_TOKEN_CHANNEL\", \"HIDDEN\" ];\r\n\r\nSketchLexer.prototype.modeNames = [ \"DEFAULT_MODE\" ];\r\n\r\nSketchLexer.prototype.literalNames = [ null, null, null, null, \"'='\", null, \r\n                                       null, null, \"'['\", \"']'\", \"';'\", \r\n                                       \"':'\", \"','\", \"'$'\", \"'.'\", \"'*'\" ];\r\n\r\nSketchLexer.prototype.symbolicNames = [ null, \"DIRECTION\", \"PARTIAL_DIRECTION\", \r\n                                        \"CURVATURE\", \"EQUAL\", \"WORD\", \"WHITESPACE\", \r\n                                        \"NUMBER\", \"START_DATA\", \"END_DATA\", \r\n                                        \"SEMICOLON\", \"COLON\", \"COMMA\", \"END_AREA\", \r\n                                        \"END\", \"STAR\", \"LABEL\" ];\r\n\r\nSketchLexer.prototype.ruleNames = [ \"LOWERCASE\", \"UPPERCASE\", \"DIGIT\", \"DIRECTION\", \r\n                                    \"PARTIAL_DIRECTION\", \"CURVATURE\", \"EQUAL\", \r\n                                    \"WORD\", \"WHITESPACE\", \"NUMBER\", \"START_DATA\", \r\n                                    \"END_DATA\", \"SEMICOLON\", \"COLON\", \"COMMA\", \r\n                                    \"END_AREA\", \"END\", \"STAR\", \"LABEL\" ];\r\n\r\nSketchLexer.prototype.grammarFileName = \"Sketch.g4\";\r\n\r\n\r\n\r\nexports.SketchLexer = SketchLexer;\r\n\r\n","// Generated from Sketch.g4 by ANTLR 4.7.1\r\n// jshint ignore: start\r\nvar antlr4 = require('antlr4/index');\r\n\r\n// This class defines a complete listener for a parse tree produced by SketchParser.\r\nfunction SketchListener() {\r\n\tantlr4.tree.ParseTreeListener.call(this);\r\n\treturn this;\r\n}\r\n\r\nSketchListener.prototype = Object.create(antlr4.tree.ParseTreeListener.prototype);\r\nSketchListener.prototype.constructor = SketchListener;\r\n\r\n// Enter a parse tree produced by SketchParser#sketch.\r\nSketchListener.prototype.enterSketch = function(ctx) {\r\n};\r\n\r\n// Exit a parse tree produced by SketchParser#sketch.\r\nSketchListener.prototype.exitSketch = function(ctx) {\r\n};\r\n\r\n\r\n// Enter a parse tree produced by SketchParser#area.\r\nSketchListener.prototype.enterArea = function(ctx) {\r\n};\r\n\r\n// Exit a parse tree produced by SketchParser#area.\r\nSketchListener.prototype.exitArea = function(ctx) {\r\n};\r\n\r\n\r\n// Enter a parse tree produced by SketchParser#name.\r\nSketchListener.prototype.enterName = function(ctx) {\r\n};\r\n\r\n// Exit a parse tree produced by SketchParser#name.\r\nSketchListener.prototype.exitName = function(ctx) {\r\n};\r\n\r\n\r\n// Enter a parse tree produced by SketchParser#origin.\r\nSketchListener.prototype.enterOrigin = function(ctx) {\r\n};\r\n\r\n// Exit a parse tree produced by SketchParser#origin.\r\nSketchListener.prototype.exitOrigin = function(ctx) {\r\n};\r\n\r\n\r\n// Enter a parse tree produced by SketchParser#multiplier.\r\nSketchListener.prototype.enterMultiplier = function(ctx) {\r\n};\r\n\r\n// Exit a parse tree produced by SketchParser#multiplier.\r\nSketchListener.prototype.exitMultiplier = function(ctx) {\r\n};\r\n\r\n\r\n// Enter a parse tree produced by SketchParser#label.\r\nSketchListener.prototype.enterLabel = function(ctx) {\r\n};\r\n\r\n// Exit a parse tree produced by SketchParser#label.\r\nSketchListener.prototype.exitLabel = function(ctx) {\r\n};\r\n\r\n\r\n// Enter a parse tree produced by SketchParser#data.\r\nSketchListener.prototype.enterData = function(ctx) {\r\n};\r\n\r\n// Exit a parse tree produced by SketchParser#data.\r\nSketchListener.prototype.exitData = function(ctx) {\r\n};\r\n\r\n\r\n// Enter a parse tree produced by SketchParser#datum.\r\nSketchListener.prototype.enterDatum = function(ctx) {\r\n};\r\n\r\n// Exit a parse tree produced by SketchParser#datum.\r\nSketchListener.prototype.exitDatum = function(ctx) {\r\n};\r\n\r\n\r\n// Enter a parse tree produced by SketchParser#data_val.\r\nSketchListener.prototype.enterData_val = function(ctx) {\r\n};\r\n\r\n// Exit a parse tree produced by SketchParser#data_val.\r\nSketchListener.prototype.exitData_val = function(ctx) {\r\n};\r\n\r\n\r\n// Enter a parse tree produced by SketchParser#segments.\r\nSketchListener.prototype.enterSegments = function(ctx) {\r\n};\r\n\r\n// Exit a parse tree produced by SketchParser#segments.\r\nSketchListener.prototype.exitSegments = function(ctx) {\r\n};\r\n\r\n\r\n// Enter a parse tree produced by SketchParser#command.\r\nSketchListener.prototype.enterCommand = function(ctx) {\r\n};\r\n\r\n// Exit a parse tree produced by SketchParser#command.\r\nSketchListener.prototype.exitCommand = function(ctx) {\r\n};\r\n\r\n\r\n// Enter a parse tree produced by SketchParser#partialCommand.\r\nSketchListener.prototype.enterPartialCommand = function(ctx) {\r\n};\r\n\r\n// Exit a parse tree produced by SketchParser#partialCommand.\r\nSketchListener.prototype.exitPartialCommand = function(ctx) {\r\n};\r\n\r\n\r\n// Enter a parse tree produced by SketchParser#direction.\r\nSketchListener.prototype.enterDirection = function(ctx) {\r\n};\r\n\r\n// Exit a parse tree produced by SketchParser#direction.\r\nSketchListener.prototype.exitDirection = function(ctx) {\r\n};\r\n\r\n\r\n// Enter a parse tree produced by SketchParser#partialDirection.\r\nSketchListener.prototype.enterPartialDirection = function(ctx) {\r\n};\r\n\r\n// Exit a parse tree produced by SketchParser#partialDirection.\r\nSketchListener.prototype.exitPartialDirection = function(ctx) {\r\n};\r\n\r\n\r\n// Enter a parse tree produced by SketchParser#steps.\r\nSketchListener.prototype.enterSteps = function(ctx) {\r\n};\r\n\r\n// Exit a parse tree produced by SketchParser#steps.\r\nSketchListener.prototype.exitSteps = function(ctx) {\r\n};\r\n\r\n\r\n// Enter a parse tree produced by SketchParser#curvature.\r\nSketchListener.prototype.enterCurvature = function(ctx) {\r\n};\r\n\r\n// Exit a parse tree produced by SketchParser#curvature.\r\nSketchListener.prototype.exitCurvature = function(ctx) {\r\n};\r\n\r\n\r\n\r\nexports.SketchListener = SketchListener;","// Generated from Sketch.g4 by ANTLR 4.7.1\r\n// jshint ignore: start\r\nvar antlr4 = require('antlr4/index');\r\nvar SketchListener = require('./SketchListener').SketchListener;\r\nvar grammarFileName = \"Sketch.g4\";\r\n\r\nvar serializedATN = [\"\\u0003\\u608b\\ua72a\\u8133\\ub9ed\\u417c\\u3be7\\u7786\\u5964\",\r\n    \"\\u0003\\u0012\\u0082\\u0004\\u0002\\t\\u0002\\u0004\\u0003\\t\\u0003\\u0004\\u0004\",\r\n    \"\\t\\u0004\\u0004\\u0005\\t\\u0005\\u0004\\u0006\\t\\u0006\\u0004\\u0007\\t\\u0007\",\r\n    \"\\u0004\\b\\t\\b\\u0004\\t\\t\\t\\u0004\\n\\t\\n\\u0004\\u000b\\t\\u000b\\u0004\\f\\t\\f\",\r\n    \"\\u0004\\r\\t\\r\\u0004\\u000e\\t\\u000e\\u0004\\u000f\\t\\u000f\\u0004\\u0010\\t\\u0010\",\r\n    \"\\u0004\\u0011\\t\\u0011\\u0003\\u0002\\u0006\\u0002$\\n\\u0002\\r\\u0002\\u000e\",\r\n    \"\\u0002%\\u0003\\u0002\\u0003\\u0002\\u0003\\u0002\\u0003\\u0003\\u0003\\u0003\",\r\n    \"\\u0005\\u0003-\\n\\u0003\\u0003\\u0003\\u0003\\u0003\\u0005\\u00031\\n\\u0003\\u0003\",\r\n    \"\\u0003\\u0003\\u0003\\u0005\\u00035\\n\\u0003\\u0003\\u0003\\u0005\\u00038\\n\\u0003\",\r\n    \"\\u0003\\u0003\\u0005\\u0003;\\n\\u0003\\u0003\\u0003\\u0005\\u0003>\\n\\u0003\\u0003\",\r\n    \"\\u0004\\u0006\\u0004A\\n\\u0004\\r\\u0004\\u000e\\u0004B\\u0003\\u0005\\u0003\\u0005\",\r\n    \"\\u0003\\u0005\\u0003\\u0005\\u0003\\u0005\\u0003\\u0005\\u0003\\u0006\\u0003\\u0006\",\r\n    \"\\u0003\\u0006\\u0003\\u0007\\u0003\\u0007\\u0003\\b\\u0003\\b\\u0006\\bR\\n\\b\\r\",\r\n    \"\\b\\u000e\\bS\\u0003\\b\\u0003\\b\\u0003\\t\\u0003\\t\\u0003\\t\\u0003\\t\\u0005\\t\",\r\n    \"\\\\\\n\\t\\u0003\\n\\u0006\\n_\\n\\n\\r\\n\\u000e\\n`\\u0003\\u000b\\u0003\\u000b\\u0003\",\r\n    \"\\u000b\\u0006\\u000bf\\n\\u000b\\r\\u000b\\u000e\\u000bg\\u0003\\f\\u0003\\f\\u0003\",\r\n    \"\\f\\u0003\\f\\u0005\\fn\\n\\f\\u0003\\r\\u0003\\r\\u0003\\r\\u0003\\r\\u0003\\r\\u0003\",\r\n    \"\\r\\u0005\\rv\\n\\r\\u0003\\u000e\\u0003\\u000e\\u0003\\u000f\\u0003\\u000f\\u0003\",\r\n    \"\\u0010\\u0003\\u0010\\u0003\\u0011\\u0003\\u0011\\u0005\\u0011\\u0080\\n\\u0011\",\r\n    \"\\u0003\\u0011\\u0002\\u0002\\u0012\\u0002\\u0004\\u0006\\b\\n\\f\\u000e\\u0010\\u0012\",\r\n    \"\\u0014\\u0016\\u0018\\u001a\\u001c\\u001e \\u0002\\u0004\\u0005\\u0002\\u0003\",\r\n    \"\\u0005\\u0007\\u0007\\t\\t\\u0003\\u0002\\u000b\\f\\u0002\\u0082\\u0002#\\u0003\",\r\n    \"\\u0002\\u0002\\u0002\\u0004*\\u0003\\u0002\\u0002\\u0002\\u0006@\\u0003\\u0002\",\r\n    \"\\u0002\\u0002\\bD\\u0003\\u0002\\u0002\\u0002\\nJ\\u0003\\u0002\\u0002\\u0002\\f\",\r\n    \"M\\u0003\\u0002\\u0002\\u0002\\u000eO\\u0003\\u0002\\u0002\\u0002\\u0010W\\u0003\",\r\n    \"\\u0002\\u0002\\u0002\\u0012^\\u0003\\u0002\\u0002\\u0002\\u0014e\\u0003\\u0002\",\r\n    \"\\u0002\\u0002\\u0016i\\u0003\\u0002\\u0002\\u0002\\u0018o\\u0003\\u0002\\u0002\",\r\n    \"\\u0002\\u001aw\\u0003\\u0002\\u0002\\u0002\\u001cy\\u0003\\u0002\\u0002\\u0002\",\r\n    \"\\u001e{\\u0003\\u0002\\u0002\\u0002 }\\u0003\\u0002\\u0002\\u0002\\\"$\\u0005\\u0004\",\r\n    \"\\u0003\\u0002#\\\"\\u0003\\u0002\\u0002\\u0002$%\\u0003\\u0002\\u0002\\u0002%#\",\r\n    \"\\u0003\\u0002\\u0002\\u0002%&\\u0003\\u0002\\u0002\\u0002&\\'\\u0003\\u0002\\u0002\",\r\n    \"\\u0002\\'(\\u0007\\u0010\\u0002\\u0002()\\u0007\\u0002\\u0002\\u0003)\\u0003\\u0003\",\r\n    \"\\u0002\\u0002\\u0002*,\\u0005\\u0006\\u0004\\u0002+-\\u0005\\b\\u0005\\u0002,\",\r\n    \"+\\u0003\\u0002\\u0002\\u0002,-\\u0003\\u0002\\u0002\\u0002-.\\u0003\\u0002\\u0002\",\r\n    \"\\u0002.0\\u0007\\u0006\\u0002\\u0002/1\\u0005\\u000e\\b\\u00020/\\u0003\\u0002\",\r\n    \"\\u0002\\u000201\\u0003\\u0002\\u0002\\u000214\\u0003\\u0002\\u0002\\u000225\\u0007\",\r\n    \"\\t\\u0002\\u000235\\u0005\\u0014\\u000b\\u000242\\u0003\\u0002\\u0002\\u00024\",\r\n    \"3\\u0003\\u0002\\u0002\\u000257\\u0003\\u0002\\u0002\\u000268\\u0007\\u000f\\u0002\",\r\n    \"\\u000276\\u0003\\u0002\\u0002\\u000278\\u0003\\u0002\\u0002\\u00028:\\u0003\\u0002\",\r\n    \"\\u0002\\u00029;\\u0005\\n\\u0006\\u0002:9\\u0003\\u0002\\u0002\\u0002:;\\u0003\",\r\n    \"\\u0002\\u0002\\u0002;=\\u0003\\u0002\\u0002\\u0002<>\\u0005\\f\\u0007\\u0002=\",\r\n    \"<\\u0003\\u0002\\u0002\\u0002=>\\u0003\\u0002\\u0002\\u0002>\\u0005\\u0003\\u0002\",\r\n    \"\\u0002\\u0002?A\\t\\u0002\\u0002\\u0002@?\\u0003\\u0002\\u0002\\u0002AB\\u0003\",\r\n    \"\\u0002\\u0002\\u0002B@\\u0003\\u0002\\u0002\\u0002BC\\u0003\\u0002\\u0002\\u0002\",\r\n    \"C\\u0007\\u0003\\u0002\\u0002\\u0002DE\\u0007\\r\\u0002\\u0002EF\\u0007\\t\\u0002\",\r\n    \"\\u0002FG\\u0007\\u000e\\u0002\\u0002GH\\u0007\\t\\u0002\\u0002HI\\u0007\\r\\u0002\",\r\n    \"\\u0002I\\t\\u0003\\u0002\\u0002\\u0002JK\\u0007\\u0011\\u0002\\u0002KL\\u0007\",\r\n    \"\\t\\u0002\\u0002L\\u000b\\u0003\\u0002\\u0002\\u0002MN\\u0007\\u0012\\u0002\\u0002\",\r\n    \"N\\r\\u0003\\u0002\\u0002\\u0002OQ\\u0007\\n\\u0002\\u0002PR\\u0005\\u0010\\t\\u0002\",\r\n    \"QP\\u0003\\u0002\\u0002\\u0002RS\\u0003\\u0002\\u0002\\u0002SQ\\u0003\\u0002\\u0002\",\r\n    \"\\u0002ST\\u0003\\u0002\\u0002\\u0002TU\\u0003\\u0002\\u0002\\u0002UV\\u0007\\u000b\",\r\n    \"\\u0002\\u0002V\\u000f\\u0003\\u0002\\u0002\\u0002WX\\u0005\\u0006\\u0004\\u0002\",\r\n    \"XY\\u0007\\u0006\\u0002\\u0002Y[\\u0005\\u0012\\n\\u0002Z\\\\\\u0007\\f\\u0002\\u0002\",\r\n    \"[Z\\u0003\\u0002\\u0002\\u0002[\\\\\\u0003\\u0002\\u0002\\u0002\\\\\\u0011\\u0003\",\r\n    \"\\u0002\\u0002\\u0002]_\\n\\u0003\\u0002\\u0002^]\\u0003\\u0002\\u0002\\u0002_\",\r\n    \"`\\u0003\\u0002\\u0002\\u0002`^\\u0003\\u0002\\u0002\\u0002`a\\u0003\\u0002\\u0002\",\r\n    \"\\u0002a\\u0013\\u0003\\u0002\\u0002\\u0002bf\\u0005\\u0016\\f\\u0002cf\\u0005\",\r\n    \"\\u0018\\r\\u0002df\\u0005\\u0004\\u0003\\u0002eb\\u0003\\u0002\\u0002\\u0002e\",\r\n    \"c\\u0003\\u0002\\u0002\\u0002ed\\u0003\\u0002\\u0002\\u0002fg\\u0003\\u0002\\u0002\",\r\n    \"\\u0002ge\\u0003\\u0002\\u0002\\u0002gh\\u0003\\u0002\\u0002\\u0002h\\u0015\\u0003\",\r\n    \"\\u0002\\u0002\\u0002ij\\u0005\\u001a\\u000e\\u0002jk\\u0005\\u001e\\u0010\\u0002\",\r\n    \"km\\u0003\\u0002\\u0002\\u0002ln\\u0005 \\u0011\\u0002ml\\u0003\\u0002\\u0002\",\r\n    \"\\u0002mn\\u0003\\u0002\\u0002\\u0002n\\u0017\\u0003\\u0002\\u0002\\u0002op\\u0005\",\r\n    \"\\u001c\\u000f\\u0002pq\\u0005\\u001e\\u0010\\u0002qr\\u0005\\u001c\\u000f\\u0002\",\r\n    \"rs\\u0005\\u001e\\u0010\\u0002su\\u0003\\u0002\\u0002\\u0002tv\\u0005 \\u0011\",\r\n    \"\\u0002ut\\u0003\\u0002\\u0002\\u0002uv\\u0003\\u0002\\u0002\\u0002v\\u0019\\u0003\",\r\n    \"\\u0002\\u0002\\u0002wx\\u0007\\u0003\\u0002\\u0002x\\u001b\\u0003\\u0002\\u0002\",\r\n    \"\\u0002yz\\u0007\\u0004\\u0002\\u0002z\\u001d\\u0003\\u0002\\u0002\\u0002{|\\u0007\",\r\n    \"\\t\\u0002\\u0002|\\u001f\\u0003\\u0002\\u0002\\u0002}\\u007f\\u0007\\u0005\\u0002\",\r\n    \"\\u0002~\\u0080\\u0007\\t\\u0002\\u0002\\u007f~\\u0003\\u0002\\u0002\\u0002\\u007f\",\r\n    \"\\u0080\\u0003\\u0002\\u0002\\u0002\\u0080!\\u0003\\u0002\\u0002\\u0002\\u0012\",\r\n    \"%,047:=BS[`egmu\\u007f\"].join(\"\");\r\n\r\n\r\nvar atn = new antlr4.atn.ATNDeserializer().deserialize(serializedATN);\r\n\r\nvar decisionsToDFA = atn.decisionToState.map( function(ds, index) { return new antlr4.dfa.DFA(ds, index); });\r\n\r\nvar sharedContextCache = new antlr4.PredictionContextCache();\r\n\r\nvar literalNames = [ null, null, null, null, \"'='\", null, null, null, \"'['\", \r\n                     \"']'\", \"';'\", \"':'\", \"','\", \"'$'\", \"'.'\", \"'*'\" ];\r\n\r\nvar symbolicNames = [ null, \"DIRECTION\", \"PARTIAL_DIRECTION\", \"CURVATURE\", \r\n                      \"EQUAL\", \"WORD\", \"WHITESPACE\", \"NUMBER\", \"START_DATA\", \r\n                      \"END_DATA\", \"SEMICOLON\", \"COLON\", \"COMMA\", \"END_AREA\", \r\n                      \"END\", \"STAR\", \"LABEL\" ];\r\n\r\nvar ruleNames =  [ \"sketch\", \"area\", \"name\", \"origin\", \"multiplier\", \"label\", \r\n                   \"data\", \"datum\", \"data_val\", \"segments\", \"command\", \"partialCommand\", \r\n                   \"direction\", \"partialDirection\", \"steps\", \"curvature\" ];\r\n\r\nfunction SketchParser (input) {\r\n\tantlr4.Parser.call(this, input);\r\n    this._interp = new antlr4.atn.ParserATNSimulator(this, atn, decisionsToDFA, sharedContextCache);\r\n    this.ruleNames = ruleNames;\r\n    this.literalNames = literalNames;\r\n    this.symbolicNames = symbolicNames;\r\n    return this;\r\n}\r\n\r\nSketchParser.prototype = Object.create(antlr4.Parser.prototype);\r\nSketchParser.prototype.constructor = SketchParser;\r\n\r\nObject.defineProperty(SketchParser.prototype, \"atn\", {\r\n\tget : function() {\r\n\t\treturn atn;\r\n\t}\r\n});\r\n\r\nSketchParser.EOF = antlr4.Token.EOF;\r\nSketchParser.DIRECTION = 1;\r\nSketchParser.PARTIAL_DIRECTION = 2;\r\nSketchParser.CURVATURE = 3;\r\nSketchParser.EQUAL = 4;\r\nSketchParser.WORD = 5;\r\nSketchParser.WHITESPACE = 6;\r\nSketchParser.NUMBER = 7;\r\nSketchParser.START_DATA = 8;\r\nSketchParser.END_DATA = 9;\r\nSketchParser.SEMICOLON = 10;\r\nSketchParser.COLON = 11;\r\nSketchParser.COMMA = 12;\r\nSketchParser.END_AREA = 13;\r\nSketchParser.END = 14;\r\nSketchParser.STAR = 15;\r\nSketchParser.LABEL = 16;\r\n\r\nSketchParser.RULE_sketch = 0;\r\nSketchParser.RULE_area = 1;\r\nSketchParser.RULE_name = 2;\r\nSketchParser.RULE_origin = 3;\r\nSketchParser.RULE_multiplier = 4;\r\nSketchParser.RULE_label = 5;\r\nSketchParser.RULE_data = 6;\r\nSketchParser.RULE_datum = 7;\r\nSketchParser.RULE_data_val = 8;\r\nSketchParser.RULE_segments = 9;\r\nSketchParser.RULE_command = 10;\r\nSketchParser.RULE_partialCommand = 11;\r\nSketchParser.RULE_direction = 12;\r\nSketchParser.RULE_partialDirection = 13;\r\nSketchParser.RULE_steps = 14;\r\nSketchParser.RULE_curvature = 15;\r\n\r\nfunction SketchContext(parser, parent, invokingState) {\r\n\tif(parent===undefined) {\r\n\t    parent = null;\r\n\t}\r\n\tif(invokingState===undefined || invokingState===null) {\r\n\t\tinvokingState = -1;\r\n\t}\r\n\tantlr4.ParserRuleContext.call(this, parent, invokingState);\r\n    this.parser = parser;\r\n    this.ruleIndex = SketchParser.RULE_sketch;\r\n    return this;\r\n}\r\n\r\nSketchContext.prototype = Object.create(antlr4.ParserRuleContext.prototype);\r\nSketchContext.prototype.constructor = SketchContext;\r\n\r\nSketchContext.prototype.END = function() {\r\n    return this.getToken(SketchParser.END, 0);\r\n};\r\n\r\nSketchContext.prototype.EOF = function() {\r\n    return this.getToken(SketchParser.EOF, 0);\r\n};\r\n\r\nSketchContext.prototype.area = function(i) {\r\n    if(i===undefined) {\r\n        i = null;\r\n    }\r\n    if(i===null) {\r\n        return this.getTypedRuleContexts(AreaContext);\r\n    } else {\r\n        return this.getTypedRuleContext(AreaContext,i);\r\n    }\r\n};\r\n\r\nSketchContext.prototype.enterRule = function(listener) {\r\n    if(listener instanceof SketchListener ) {\r\n        listener.enterSketch(this);\r\n\t}\r\n};\r\n\r\nSketchContext.prototype.exitRule = function(listener) {\r\n    if(listener instanceof SketchListener ) {\r\n        listener.exitSketch(this);\r\n\t}\r\n};\r\n\r\n\r\n\r\n\r\nSketchParser.SketchContext = SketchContext;\r\n\r\nSketchParser.prototype.sketch = function() {\r\n\r\n    var localctx = new SketchContext(this, this._ctx, this.state);\r\n    this.enterRule(localctx, 0, SketchParser.RULE_sketch);\r\n    var _la = 0; // Token type\r\n    try {\r\n        this.enterOuterAlt(localctx, 1);\r\n        this.state = 33; \r\n        this._errHandler.sync(this);\r\n        _la = this._input.LA(1);\r\n        do {\r\n            this.state = 32;\r\n            this.area();\r\n            this.state = 35; \r\n            this._errHandler.sync(this);\r\n            _la = this._input.LA(1);\r\n        } while((((_la) & ~0x1f) == 0 && ((1 << _la) & ((1 << SketchParser.DIRECTION) | (1 << SketchParser.PARTIAL_DIRECTION) | (1 << SketchParser.CURVATURE) | (1 << SketchParser.WORD) | (1 << SketchParser.NUMBER))) !== 0));\r\n        this.state = 37;\r\n        this.match(SketchParser.END);\r\n        this.state = 38;\r\n        this.match(SketchParser.EOF);\r\n    } catch (re) {\r\n    \tif(re instanceof antlr4.error.RecognitionException) {\r\n\t        localctx.exception = re;\r\n\t        this._errHandler.reportError(this, re);\r\n\t        this._errHandler.recover(this, re);\r\n\t    } else {\r\n\t    \tthrow re;\r\n\t    }\r\n    } finally {\r\n        this.exitRule();\r\n    }\r\n    return localctx;\r\n};\r\n\r\nfunction AreaContext(parser, parent, invokingState) {\r\n\tif(parent===undefined) {\r\n\t    parent = null;\r\n\t}\r\n\tif(invokingState===undefined || invokingState===null) {\r\n\t\tinvokingState = -1;\r\n\t}\r\n\tantlr4.ParserRuleContext.call(this, parent, invokingState);\r\n    this.parser = parser;\r\n    this.ruleIndex = SketchParser.RULE_area;\r\n    return this;\r\n}\r\n\r\nAreaContext.prototype = Object.create(antlr4.ParserRuleContext.prototype);\r\nAreaContext.prototype.constructor = AreaContext;\r\n\r\nAreaContext.prototype.name = function() {\r\n    return this.getTypedRuleContext(NameContext,0);\r\n};\r\n\r\nAreaContext.prototype.EQUAL = function() {\r\n    return this.getToken(SketchParser.EQUAL, 0);\r\n};\r\n\r\nAreaContext.prototype.NUMBER = function() {\r\n    return this.getToken(SketchParser.NUMBER, 0);\r\n};\r\n\r\nAreaContext.prototype.segments = function() {\r\n    return this.getTypedRuleContext(SegmentsContext,0);\r\n};\r\n\r\nAreaContext.prototype.origin = function() {\r\n    return this.getTypedRuleContext(OriginContext,0);\r\n};\r\n\r\nAreaContext.prototype.data = function() {\r\n    return this.getTypedRuleContext(DataContext,0);\r\n};\r\n\r\nAreaContext.prototype.END_AREA = function() {\r\n    return this.getToken(SketchParser.END_AREA, 0);\r\n};\r\n\r\nAreaContext.prototype.multiplier = function() {\r\n    return this.getTypedRuleContext(MultiplierContext,0);\r\n};\r\n\r\nAreaContext.prototype.label = function() {\r\n    return this.getTypedRuleContext(LabelContext,0);\r\n};\r\n\r\nAreaContext.prototype.enterRule = function(listener) {\r\n    if(listener instanceof SketchListener ) {\r\n        listener.enterArea(this);\r\n\t}\r\n};\r\n\r\nAreaContext.prototype.exitRule = function(listener) {\r\n    if(listener instanceof SketchListener ) {\r\n        listener.exitArea(this);\r\n\t}\r\n};\r\n\r\n\r\n\r\n\r\nSketchParser.AreaContext = AreaContext;\r\n\r\nSketchParser.prototype.area = function() {\r\n\r\n    var localctx = new AreaContext(this, this._ctx, this.state);\r\n    this.enterRule(localctx, 2, SketchParser.RULE_area);\r\n    var _la = 0; // Token type\r\n    try {\r\n        this.enterOuterAlt(localctx, 1);\r\n        this.state = 40;\r\n        this.name();\r\n        this.state = 42;\r\n        this._errHandler.sync(this);\r\n        _la = this._input.LA(1);\r\n        if(_la===SketchParser.COLON) {\r\n            this.state = 41;\r\n            this.origin();\r\n        }\r\n\r\n        this.state = 44;\r\n        this.match(SketchParser.EQUAL);\r\n        this.state = 46;\r\n        this._errHandler.sync(this);\r\n        _la = this._input.LA(1);\r\n        if(_la===SketchParser.START_DATA) {\r\n            this.state = 45;\r\n            this.data();\r\n        }\r\n\r\n        this.state = 50;\r\n        this._errHandler.sync(this);\r\n        var la_ = this._interp.adaptivePredict(this._input,3,this._ctx);\r\n        switch(la_) {\r\n        case 1:\r\n            this.state = 48;\r\n            this.match(SketchParser.NUMBER);\r\n            break;\r\n\r\n        case 2:\r\n            this.state = 49;\r\n            this.segments();\r\n            break;\r\n\r\n        }\r\n        this.state = 53;\r\n        this._errHandler.sync(this);\r\n        var la_ = this._interp.adaptivePredict(this._input,4,this._ctx);\r\n        if(la_===1) {\r\n            this.state = 52;\r\n            this.match(SketchParser.END_AREA);\r\n\r\n        }\r\n        this.state = 56;\r\n        this._errHandler.sync(this);\r\n        var la_ = this._interp.adaptivePredict(this._input,5,this._ctx);\r\n        if(la_===1) {\r\n            this.state = 55;\r\n            this.multiplier();\r\n\r\n        }\r\n        this.state = 59;\r\n        this._errHandler.sync(this);\r\n        var la_ = this._interp.adaptivePredict(this._input,6,this._ctx);\r\n        if(la_===1) {\r\n            this.state = 58;\r\n            this.label();\r\n\r\n        }\r\n    } catch (re) {\r\n    \tif(re instanceof antlr4.error.RecognitionException) {\r\n\t        localctx.exception = re;\r\n\t        this._errHandler.reportError(this, re);\r\n\t        this._errHandler.recover(this, re);\r\n\t    } else {\r\n\t    \tthrow re;\r\n\t    }\r\n    } finally {\r\n        this.exitRule();\r\n    }\r\n    return localctx;\r\n};\r\n\r\nfunction NameContext(parser, parent, invokingState) {\r\n\tif(parent===undefined) {\r\n\t    parent = null;\r\n\t}\r\n\tif(invokingState===undefined || invokingState===null) {\r\n\t\tinvokingState = -1;\r\n\t}\r\n\tantlr4.ParserRuleContext.call(this, parent, invokingState);\r\n    this.parser = parser;\r\n    this.ruleIndex = SketchParser.RULE_name;\r\n    return this;\r\n}\r\n\r\nNameContext.prototype = Object.create(antlr4.ParserRuleContext.prototype);\r\nNameContext.prototype.constructor = NameContext;\r\n\r\nNameContext.prototype.WORD = function(i) {\r\n\tif(i===undefined) {\r\n\t\ti = null;\r\n\t}\r\n    if(i===null) {\r\n        return this.getTokens(SketchParser.WORD);\r\n    } else {\r\n        return this.getToken(SketchParser.WORD, i);\r\n    }\r\n};\r\n\r\n\r\nNameContext.prototype.NUMBER = function(i) {\r\n\tif(i===undefined) {\r\n\t\ti = null;\r\n\t}\r\n    if(i===null) {\r\n        return this.getTokens(SketchParser.NUMBER);\r\n    } else {\r\n        return this.getToken(SketchParser.NUMBER, i);\r\n    }\r\n};\r\n\r\n\r\nNameContext.prototype.DIRECTION = function(i) {\r\n\tif(i===undefined) {\r\n\t\ti = null;\r\n\t}\r\n    if(i===null) {\r\n        return this.getTokens(SketchParser.DIRECTION);\r\n    } else {\r\n        return this.getToken(SketchParser.DIRECTION, i);\r\n    }\r\n};\r\n\r\n\r\nNameContext.prototype.PARTIAL_DIRECTION = function(i) {\r\n\tif(i===undefined) {\r\n\t\ti = null;\r\n\t}\r\n    if(i===null) {\r\n        return this.getTokens(SketchParser.PARTIAL_DIRECTION);\r\n    } else {\r\n        return this.getToken(SketchParser.PARTIAL_DIRECTION, i);\r\n    }\r\n};\r\n\r\n\r\nNameContext.prototype.CURVATURE = function(i) {\r\n\tif(i===undefined) {\r\n\t\ti = null;\r\n\t}\r\n    if(i===null) {\r\n        return this.getTokens(SketchParser.CURVATURE);\r\n    } else {\r\n        return this.getToken(SketchParser.CURVATURE, i);\r\n    }\r\n};\r\n\r\n\r\nNameContext.prototype.enterRule = function(listener) {\r\n    if(listener instanceof SketchListener ) {\r\n        listener.enterName(this);\r\n\t}\r\n};\r\n\r\nNameContext.prototype.exitRule = function(listener) {\r\n    if(listener instanceof SketchListener ) {\r\n        listener.exitName(this);\r\n\t}\r\n};\r\n\r\n\r\n\r\n\r\nSketchParser.NameContext = NameContext;\r\n\r\nSketchParser.prototype.name = function() {\r\n\r\n    var localctx = new NameContext(this, this._ctx, this.state);\r\n    this.enterRule(localctx, 4, SketchParser.RULE_name);\r\n    var _la = 0; // Token type\r\n    try {\r\n        this.enterOuterAlt(localctx, 1);\r\n        this.state = 62; \r\n        this._errHandler.sync(this);\r\n        _la = this._input.LA(1);\r\n        do {\r\n            this.state = 61;\r\n            _la = this._input.LA(1);\r\n            if(!((((_la) & ~0x1f) == 0 && ((1 << _la) & ((1 << SketchParser.DIRECTION) | (1 << SketchParser.PARTIAL_DIRECTION) | (1 << SketchParser.CURVATURE) | (1 << SketchParser.WORD) | (1 << SketchParser.NUMBER))) !== 0))) {\r\n            this._errHandler.recoverInline(this);\r\n            }\r\n            else {\r\n            \tthis._errHandler.reportMatch(this);\r\n                this.consume();\r\n            }\r\n            this.state = 64; \r\n            this._errHandler.sync(this);\r\n            _la = this._input.LA(1);\r\n        } while((((_la) & ~0x1f) == 0 && ((1 << _la) & ((1 << SketchParser.DIRECTION) | (1 << SketchParser.PARTIAL_DIRECTION) | (1 << SketchParser.CURVATURE) | (1 << SketchParser.WORD) | (1 << SketchParser.NUMBER))) !== 0));\r\n    } catch (re) {\r\n    \tif(re instanceof antlr4.error.RecognitionException) {\r\n\t        localctx.exception = re;\r\n\t        this._errHandler.reportError(this, re);\r\n\t        this._errHandler.recover(this, re);\r\n\t    } else {\r\n\t    \tthrow re;\r\n\t    }\r\n    } finally {\r\n        this.exitRule();\r\n    }\r\n    return localctx;\r\n};\r\n\r\nfunction OriginContext(parser, parent, invokingState) {\r\n\tif(parent===undefined) {\r\n\t    parent = null;\r\n\t}\r\n\tif(invokingState===undefined || invokingState===null) {\r\n\t\tinvokingState = -1;\r\n\t}\r\n\tantlr4.ParserRuleContext.call(this, parent, invokingState);\r\n    this.parser = parser;\r\n    this.ruleIndex = SketchParser.RULE_origin;\r\n    return this;\r\n}\r\n\r\nOriginContext.prototype = Object.create(antlr4.ParserRuleContext.prototype);\r\nOriginContext.prototype.constructor = OriginContext;\r\n\r\nOriginContext.prototype.COLON = function(i) {\r\n\tif(i===undefined) {\r\n\t\ti = null;\r\n\t}\r\n    if(i===null) {\r\n        return this.getTokens(SketchParser.COLON);\r\n    } else {\r\n        return this.getToken(SketchParser.COLON, i);\r\n    }\r\n};\r\n\r\n\r\nOriginContext.prototype.NUMBER = function(i) {\r\n\tif(i===undefined) {\r\n\t\ti = null;\r\n\t}\r\n    if(i===null) {\r\n        return this.getTokens(SketchParser.NUMBER);\r\n    } else {\r\n        return this.getToken(SketchParser.NUMBER, i);\r\n    }\r\n};\r\n\r\n\r\nOriginContext.prototype.COMMA = function() {\r\n    return this.getToken(SketchParser.COMMA, 0);\r\n};\r\n\r\nOriginContext.prototype.enterRule = function(listener) {\r\n    if(listener instanceof SketchListener ) {\r\n        listener.enterOrigin(this);\r\n\t}\r\n};\r\n\r\nOriginContext.prototype.exitRule = function(listener) {\r\n    if(listener instanceof SketchListener ) {\r\n        listener.exitOrigin(this);\r\n\t}\r\n};\r\n\r\n\r\n\r\n\r\nSketchParser.OriginContext = OriginContext;\r\n\r\nSketchParser.prototype.origin = function() {\r\n\r\n    var localctx = new OriginContext(this, this._ctx, this.state);\r\n    this.enterRule(localctx, 6, SketchParser.RULE_origin);\r\n    try {\r\n        this.enterOuterAlt(localctx, 1);\r\n        this.state = 66;\r\n        this.match(SketchParser.COLON);\r\n        this.state = 67;\r\n        this.match(SketchParser.NUMBER);\r\n        this.state = 68;\r\n        this.match(SketchParser.COMMA);\r\n        this.state = 69;\r\n        this.match(SketchParser.NUMBER);\r\n        this.state = 70;\r\n        this.match(SketchParser.COLON);\r\n    } catch (re) {\r\n    \tif(re instanceof antlr4.error.RecognitionException) {\r\n\t        localctx.exception = re;\r\n\t        this._errHandler.reportError(this, re);\r\n\t        this._errHandler.recover(this, re);\r\n\t    } else {\r\n\t    \tthrow re;\r\n\t    }\r\n    } finally {\r\n        this.exitRule();\r\n    }\r\n    return localctx;\r\n};\r\n\r\nfunction MultiplierContext(parser, parent, invokingState) {\r\n\tif(parent===undefined) {\r\n\t    parent = null;\r\n\t}\r\n\tif(invokingState===undefined || invokingState===null) {\r\n\t\tinvokingState = -1;\r\n\t}\r\n\tantlr4.ParserRuleContext.call(this, parent, invokingState);\r\n    this.parser = parser;\r\n    this.ruleIndex = SketchParser.RULE_multiplier;\r\n    return this;\r\n}\r\n\r\nMultiplierContext.prototype = Object.create(antlr4.ParserRuleContext.prototype);\r\nMultiplierContext.prototype.constructor = MultiplierContext;\r\n\r\nMultiplierContext.prototype.STAR = function() {\r\n    return this.getToken(SketchParser.STAR, 0);\r\n};\r\n\r\nMultiplierContext.prototype.NUMBER = function() {\r\n    return this.getToken(SketchParser.NUMBER, 0);\r\n};\r\n\r\nMultiplierContext.prototype.enterRule = function(listener) {\r\n    if(listener instanceof SketchListener ) {\r\n        listener.enterMultiplier(this);\r\n\t}\r\n};\r\n\r\nMultiplierContext.prototype.exitRule = function(listener) {\r\n    if(listener instanceof SketchListener ) {\r\n        listener.exitMultiplier(this);\r\n\t}\r\n};\r\n\r\n\r\n\r\n\r\nSketchParser.MultiplierContext = MultiplierContext;\r\n\r\nSketchParser.prototype.multiplier = function() {\r\n\r\n    var localctx = new MultiplierContext(this, this._ctx, this.state);\r\n    this.enterRule(localctx, 8, SketchParser.RULE_multiplier);\r\n    try {\r\n        this.enterOuterAlt(localctx, 1);\r\n        this.state = 72;\r\n        this.match(SketchParser.STAR);\r\n        this.state = 73;\r\n        this.match(SketchParser.NUMBER);\r\n    } catch (re) {\r\n    \tif(re instanceof antlr4.error.RecognitionException) {\r\n\t        localctx.exception = re;\r\n\t        this._errHandler.reportError(this, re);\r\n\t        this._errHandler.recover(this, re);\r\n\t    } else {\r\n\t    \tthrow re;\r\n\t    }\r\n    } finally {\r\n        this.exitRule();\r\n    }\r\n    return localctx;\r\n};\r\n\r\nfunction LabelContext(parser, parent, invokingState) {\r\n\tif(parent===undefined) {\r\n\t    parent = null;\r\n\t}\r\n\tif(invokingState===undefined || invokingState===null) {\r\n\t\tinvokingState = -1;\r\n\t}\r\n\tantlr4.ParserRuleContext.call(this, parent, invokingState);\r\n    this.parser = parser;\r\n    this.ruleIndex = SketchParser.RULE_label;\r\n    return this;\r\n}\r\n\r\nLabelContext.prototype = Object.create(antlr4.ParserRuleContext.prototype);\r\nLabelContext.prototype.constructor = LabelContext;\r\n\r\nLabelContext.prototype.LABEL = function() {\r\n    return this.getToken(SketchParser.LABEL, 0);\r\n};\r\n\r\nLabelContext.prototype.enterRule = function(listener) {\r\n    if(listener instanceof SketchListener ) {\r\n        listener.enterLabel(this);\r\n\t}\r\n};\r\n\r\nLabelContext.prototype.exitRule = function(listener) {\r\n    if(listener instanceof SketchListener ) {\r\n        listener.exitLabel(this);\r\n\t}\r\n};\r\n\r\n\r\n\r\n\r\nSketchParser.LabelContext = LabelContext;\r\n\r\nSketchParser.prototype.label = function() {\r\n\r\n    var localctx = new LabelContext(this, this._ctx, this.state);\r\n    this.enterRule(localctx, 10, SketchParser.RULE_label);\r\n    try {\r\n        this.enterOuterAlt(localctx, 1);\r\n        this.state = 75;\r\n        this.match(SketchParser.LABEL);\r\n    } catch (re) {\r\n    \tif(re instanceof antlr4.error.RecognitionException) {\r\n\t        localctx.exception = re;\r\n\t        this._errHandler.reportError(this, re);\r\n\t        this._errHandler.recover(this, re);\r\n\t    } else {\r\n\t    \tthrow re;\r\n\t    }\r\n    } finally {\r\n        this.exitRule();\r\n    }\r\n    return localctx;\r\n};\r\n\r\nfunction DataContext(parser, parent, invokingState) {\r\n\tif(parent===undefined) {\r\n\t    parent = null;\r\n\t}\r\n\tif(invokingState===undefined || invokingState===null) {\r\n\t\tinvokingState = -1;\r\n\t}\r\n\tantlr4.ParserRuleContext.call(this, parent, invokingState);\r\n    this.parser = parser;\r\n    this.ruleIndex = SketchParser.RULE_data;\r\n    return this;\r\n}\r\n\r\nDataContext.prototype = Object.create(antlr4.ParserRuleContext.prototype);\r\nDataContext.prototype.constructor = DataContext;\r\n\r\nDataContext.prototype.START_DATA = function() {\r\n    return this.getToken(SketchParser.START_DATA, 0);\r\n};\r\n\r\nDataContext.prototype.END_DATA = function() {\r\n    return this.getToken(SketchParser.END_DATA, 0);\r\n};\r\n\r\nDataContext.prototype.datum = function(i) {\r\n    if(i===undefined) {\r\n        i = null;\r\n    }\r\n    if(i===null) {\r\n        return this.getTypedRuleContexts(DatumContext);\r\n    } else {\r\n        return this.getTypedRuleContext(DatumContext,i);\r\n    }\r\n};\r\n\r\nDataContext.prototype.enterRule = function(listener) {\r\n    if(listener instanceof SketchListener ) {\r\n        listener.enterData(this);\r\n\t}\r\n};\r\n\r\nDataContext.prototype.exitRule = function(listener) {\r\n    if(listener instanceof SketchListener ) {\r\n        listener.exitData(this);\r\n\t}\r\n};\r\n\r\n\r\n\r\n\r\nSketchParser.DataContext = DataContext;\r\n\r\nSketchParser.prototype.data = function() {\r\n\r\n    var localctx = new DataContext(this, this._ctx, this.state);\r\n    this.enterRule(localctx, 12, SketchParser.RULE_data);\r\n    var _la = 0; // Token type\r\n    try {\r\n        this.enterOuterAlt(localctx, 1);\r\n        this.state = 77;\r\n        this.match(SketchParser.START_DATA);\r\n        this.state = 79; \r\n        this._errHandler.sync(this);\r\n        _la = this._input.LA(1);\r\n        do {\r\n            this.state = 78;\r\n            this.datum();\r\n            this.state = 81; \r\n            this._errHandler.sync(this);\r\n            _la = this._input.LA(1);\r\n        } while((((_la) & ~0x1f) == 0 && ((1 << _la) & ((1 << SketchParser.DIRECTION) | (1 << SketchParser.PARTIAL_DIRECTION) | (1 << SketchParser.CURVATURE) | (1 << SketchParser.WORD) | (1 << SketchParser.NUMBER))) !== 0));\r\n        this.state = 83;\r\n        this.match(SketchParser.END_DATA);\r\n    } catch (re) {\r\n    \tif(re instanceof antlr4.error.RecognitionException) {\r\n\t        localctx.exception = re;\r\n\t        this._errHandler.reportError(this, re);\r\n\t        this._errHandler.recover(this, re);\r\n\t    } else {\r\n\t    \tthrow re;\r\n\t    }\r\n    } finally {\r\n        this.exitRule();\r\n    }\r\n    return localctx;\r\n};\r\n\r\nfunction DatumContext(parser, parent, invokingState) {\r\n\tif(parent===undefined) {\r\n\t    parent = null;\r\n\t}\r\n\tif(invokingState===undefined || invokingState===null) {\r\n\t\tinvokingState = -1;\r\n\t}\r\n\tantlr4.ParserRuleContext.call(this, parent, invokingState);\r\n    this.parser = parser;\r\n    this.ruleIndex = SketchParser.RULE_datum;\r\n    return this;\r\n}\r\n\r\nDatumContext.prototype = Object.create(antlr4.ParserRuleContext.prototype);\r\nDatumContext.prototype.constructor = DatumContext;\r\n\r\nDatumContext.prototype.name = function() {\r\n    return this.getTypedRuleContext(NameContext,0);\r\n};\r\n\r\nDatumContext.prototype.EQUAL = function() {\r\n    return this.getToken(SketchParser.EQUAL, 0);\r\n};\r\n\r\nDatumContext.prototype.data_val = function() {\r\n    return this.getTypedRuleContext(Data_valContext,0);\r\n};\r\n\r\nDatumContext.prototype.SEMICOLON = function() {\r\n    return this.getToken(SketchParser.SEMICOLON, 0);\r\n};\r\n\r\nDatumContext.prototype.enterRule = function(listener) {\r\n    if(listener instanceof SketchListener ) {\r\n        listener.enterDatum(this);\r\n\t}\r\n};\r\n\r\nDatumContext.prototype.exitRule = function(listener) {\r\n    if(listener instanceof SketchListener ) {\r\n        listener.exitDatum(this);\r\n\t}\r\n};\r\n\r\n\r\n\r\n\r\nSketchParser.DatumContext = DatumContext;\r\n\r\nSketchParser.prototype.datum = function() {\r\n\r\n    var localctx = new DatumContext(this, this._ctx, this.state);\r\n    this.enterRule(localctx, 14, SketchParser.RULE_datum);\r\n    var _la = 0; // Token type\r\n    try {\r\n        this.enterOuterAlt(localctx, 1);\r\n        this.state = 85;\r\n        this.name();\r\n        this.state = 86;\r\n        this.match(SketchParser.EQUAL);\r\n        this.state = 87;\r\n        this.data_val();\r\n        this.state = 89;\r\n        this._errHandler.sync(this);\r\n        _la = this._input.LA(1);\r\n        if(_la===SketchParser.SEMICOLON) {\r\n            this.state = 88;\r\n            this.match(SketchParser.SEMICOLON);\r\n        }\r\n\r\n    } catch (re) {\r\n    \tif(re instanceof antlr4.error.RecognitionException) {\r\n\t        localctx.exception = re;\r\n\t        this._errHandler.reportError(this, re);\r\n\t        this._errHandler.recover(this, re);\r\n\t    } else {\r\n\t    \tthrow re;\r\n\t    }\r\n    } finally {\r\n        this.exitRule();\r\n    }\r\n    return localctx;\r\n};\r\n\r\nfunction Data_valContext(parser, parent, invokingState) {\r\n\tif(parent===undefined) {\r\n\t    parent = null;\r\n\t}\r\n\tif(invokingState===undefined || invokingState===null) {\r\n\t\tinvokingState = -1;\r\n\t}\r\n\tantlr4.ParserRuleContext.call(this, parent, invokingState);\r\n    this.parser = parser;\r\n    this.ruleIndex = SketchParser.RULE_data_val;\r\n    return this;\r\n}\r\n\r\nData_valContext.prototype = Object.create(antlr4.ParserRuleContext.prototype);\r\nData_valContext.prototype.constructor = Data_valContext;\r\n\r\nData_valContext.prototype.SEMICOLON = function(i) {\r\n\tif(i===undefined) {\r\n\t\ti = null;\r\n\t}\r\n    if(i===null) {\r\n        return this.getTokens(SketchParser.SEMICOLON);\r\n    } else {\r\n        return this.getToken(SketchParser.SEMICOLON, i);\r\n    }\r\n};\r\n\r\n\r\nData_valContext.prototype.END_DATA = function(i) {\r\n\tif(i===undefined) {\r\n\t\ti = null;\r\n\t}\r\n    if(i===null) {\r\n        return this.getTokens(SketchParser.END_DATA);\r\n    } else {\r\n        return this.getToken(SketchParser.END_DATA, i);\r\n    }\r\n};\r\n\r\n\r\nData_valContext.prototype.enterRule = function(listener) {\r\n    if(listener instanceof SketchListener ) {\r\n        listener.enterData_val(this);\r\n\t}\r\n};\r\n\r\nData_valContext.prototype.exitRule = function(listener) {\r\n    if(listener instanceof SketchListener ) {\r\n        listener.exitData_val(this);\r\n\t}\r\n};\r\n\r\n\r\n\r\n\r\nSketchParser.Data_valContext = Data_valContext;\r\n\r\nSketchParser.prototype.data_val = function() {\r\n\r\n    var localctx = new Data_valContext(this, this._ctx, this.state);\r\n    this.enterRule(localctx, 16, SketchParser.RULE_data_val);\r\n    var _la = 0; // Token type\r\n    try {\r\n        this.enterOuterAlt(localctx, 1);\r\n        this.state = 92; \r\n        this._errHandler.sync(this);\r\n        var _alt = 1;\r\n        do {\r\n        \tswitch (_alt) {\r\n        \tcase 1:\r\n        \t\tthis.state = 91;\r\n        \t\t_la = this._input.LA(1);\r\n        \t\tif(_la<=0 || _la===SketchParser.END_DATA || _la===SketchParser.SEMICOLON) {\r\n        \t\tthis._errHandler.recoverInline(this);\r\n        \t\t}\r\n        \t\telse {\r\n        \t\t\tthis._errHandler.reportMatch(this);\r\n        \t\t    this.consume();\r\n        \t\t}\r\n        \t\tbreak;\r\n        \tdefault:\r\n        \t\tthrow new antlr4.error.NoViableAltException(this);\r\n        \t}\r\n        \tthis.state = 94; \r\n        \tthis._errHandler.sync(this);\r\n        \t_alt = this._interp.adaptivePredict(this._input,10, this._ctx);\r\n        } while ( _alt!=2 && _alt!=antlr4.atn.ATN.INVALID_ALT_NUMBER );\r\n    } catch (re) {\r\n    \tif(re instanceof antlr4.error.RecognitionException) {\r\n\t        localctx.exception = re;\r\n\t        this._errHandler.reportError(this, re);\r\n\t        this._errHandler.recover(this, re);\r\n\t    } else {\r\n\t    \tthrow re;\r\n\t    }\r\n    } finally {\r\n        this.exitRule();\r\n    }\r\n    return localctx;\r\n};\r\n\r\nfunction SegmentsContext(parser, parent, invokingState) {\r\n\tif(parent===undefined) {\r\n\t    parent = null;\r\n\t}\r\n\tif(invokingState===undefined || invokingState===null) {\r\n\t\tinvokingState = -1;\r\n\t}\r\n\tantlr4.ParserRuleContext.call(this, parent, invokingState);\r\n    this.parser = parser;\r\n    this.ruleIndex = SketchParser.RULE_segments;\r\n    return this;\r\n}\r\n\r\nSegmentsContext.prototype = Object.create(antlr4.ParserRuleContext.prototype);\r\nSegmentsContext.prototype.constructor = SegmentsContext;\r\n\r\nSegmentsContext.prototype.command = function(i) {\r\n    if(i===undefined) {\r\n        i = null;\r\n    }\r\n    if(i===null) {\r\n        return this.getTypedRuleContexts(CommandContext);\r\n    } else {\r\n        return this.getTypedRuleContext(CommandContext,i);\r\n    }\r\n};\r\n\r\nSegmentsContext.prototype.partialCommand = function(i) {\r\n    if(i===undefined) {\r\n        i = null;\r\n    }\r\n    if(i===null) {\r\n        return this.getTypedRuleContexts(PartialCommandContext);\r\n    } else {\r\n        return this.getTypedRuleContext(PartialCommandContext,i);\r\n    }\r\n};\r\n\r\nSegmentsContext.prototype.area = function(i) {\r\n    if(i===undefined) {\r\n        i = null;\r\n    }\r\n    if(i===null) {\r\n        return this.getTypedRuleContexts(AreaContext);\r\n    } else {\r\n        return this.getTypedRuleContext(AreaContext,i);\r\n    }\r\n};\r\n\r\nSegmentsContext.prototype.enterRule = function(listener) {\r\n    if(listener instanceof SketchListener ) {\r\n        listener.enterSegments(this);\r\n\t}\r\n};\r\n\r\nSegmentsContext.prototype.exitRule = function(listener) {\r\n    if(listener instanceof SketchListener ) {\r\n        listener.exitSegments(this);\r\n\t}\r\n};\r\n\r\n\r\n\r\n\r\nSketchParser.SegmentsContext = SegmentsContext;\r\n\r\nSketchParser.prototype.segments = function() {\r\n\r\n    var localctx = new SegmentsContext(this, this._ctx, this.state);\r\n    this.enterRule(localctx, 18, SketchParser.RULE_segments);\r\n    try {\r\n        this.enterOuterAlt(localctx, 1);\r\n        this.state = 99; \r\n        this._errHandler.sync(this);\r\n        var _alt = 1;\r\n        do {\r\n        \tswitch (_alt) {\r\n        \tcase 1:\r\n        \t\tthis.state = 99;\r\n        \t\tthis._errHandler.sync(this);\r\n        \t\tvar la_ = this._interp.adaptivePredict(this._input,11,this._ctx);\r\n        \t\tswitch(la_) {\r\n        \t\tcase 1:\r\n        \t\t    this.state = 96;\r\n        \t\t    this.command();\r\n        \t\t    break;\r\n\r\n        \t\tcase 2:\r\n        \t\t    this.state = 97;\r\n        \t\t    this.partialCommand();\r\n        \t\t    break;\r\n\r\n        \t\tcase 3:\r\n        \t\t    this.state = 98;\r\n        \t\t    this.area();\r\n        \t\t    break;\r\n\r\n        \t\t}\r\n        \t\tbreak;\r\n        \tdefault:\r\n        \t\tthrow new antlr4.error.NoViableAltException(this);\r\n        \t}\r\n        \tthis.state = 101; \r\n        \tthis._errHandler.sync(this);\r\n        \t_alt = this._interp.adaptivePredict(this._input,12, this._ctx);\r\n        } while ( _alt!=2 && _alt!=antlr4.atn.ATN.INVALID_ALT_NUMBER );\r\n    } catch (re) {\r\n    \tif(re instanceof antlr4.error.RecognitionException) {\r\n\t        localctx.exception = re;\r\n\t        this._errHandler.reportError(this, re);\r\n\t        this._errHandler.recover(this, re);\r\n\t    } else {\r\n\t    \tthrow re;\r\n\t    }\r\n    } finally {\r\n        this.exitRule();\r\n    }\r\n    return localctx;\r\n};\r\n\r\nfunction CommandContext(parser, parent, invokingState) {\r\n\tif(parent===undefined) {\r\n\t    parent = null;\r\n\t}\r\n\tif(invokingState===undefined || invokingState===null) {\r\n\t\tinvokingState = -1;\r\n\t}\r\n\tantlr4.ParserRuleContext.call(this, parent, invokingState);\r\n    this.parser = parser;\r\n    this.ruleIndex = SketchParser.RULE_command;\r\n    return this;\r\n}\r\n\r\nCommandContext.prototype = Object.create(antlr4.ParserRuleContext.prototype);\r\nCommandContext.prototype.constructor = CommandContext;\r\n\r\nCommandContext.prototype.direction = function() {\r\n    return this.getTypedRuleContext(DirectionContext,0);\r\n};\r\n\r\nCommandContext.prototype.steps = function() {\r\n    return this.getTypedRuleContext(StepsContext,0);\r\n};\r\n\r\nCommandContext.prototype.curvature = function() {\r\n    return this.getTypedRuleContext(CurvatureContext,0);\r\n};\r\n\r\nCommandContext.prototype.enterRule = function(listener) {\r\n    if(listener instanceof SketchListener ) {\r\n        listener.enterCommand(this);\r\n\t}\r\n};\r\n\r\nCommandContext.prototype.exitRule = function(listener) {\r\n    if(listener instanceof SketchListener ) {\r\n        listener.exitCommand(this);\r\n\t}\r\n};\r\n\r\n\r\n\r\n\r\nSketchParser.CommandContext = CommandContext;\r\n\r\nSketchParser.prototype.command = function() {\r\n\r\n    var localctx = new CommandContext(this, this._ctx, this.state);\r\n    this.enterRule(localctx, 20, SketchParser.RULE_command);\r\n    try {\r\n        this.enterOuterAlt(localctx, 1);\r\n        this.state = 103;\r\n        this.direction();\r\n        this.state = 104;\r\n        this.steps();\r\n        this.state = 107;\r\n        this._errHandler.sync(this);\r\n        var la_ = this._interp.adaptivePredict(this._input,13,this._ctx);\r\n        if(la_===1) {\r\n            this.state = 106;\r\n            this.curvature();\r\n\r\n        }\r\n    } catch (re) {\r\n    \tif(re instanceof antlr4.error.RecognitionException) {\r\n\t        localctx.exception = re;\r\n\t        this._errHandler.reportError(this, re);\r\n\t        this._errHandler.recover(this, re);\r\n\t    } else {\r\n\t    \tthrow re;\r\n\t    }\r\n    } finally {\r\n        this.exitRule();\r\n    }\r\n    return localctx;\r\n};\r\n\r\nfunction PartialCommandContext(parser, parent, invokingState) {\r\n\tif(parent===undefined) {\r\n\t    parent = null;\r\n\t}\r\n\tif(invokingState===undefined || invokingState===null) {\r\n\t\tinvokingState = -1;\r\n\t}\r\n\tantlr4.ParserRuleContext.call(this, parent, invokingState);\r\n    this.parser = parser;\r\n    this.ruleIndex = SketchParser.RULE_partialCommand;\r\n    return this;\r\n}\r\n\r\nPartialCommandContext.prototype = Object.create(antlr4.ParserRuleContext.prototype);\r\nPartialCommandContext.prototype.constructor = PartialCommandContext;\r\n\r\nPartialCommandContext.prototype.partialDirection = function(i) {\r\n    if(i===undefined) {\r\n        i = null;\r\n    }\r\n    if(i===null) {\r\n        return this.getTypedRuleContexts(PartialDirectionContext);\r\n    } else {\r\n        return this.getTypedRuleContext(PartialDirectionContext,i);\r\n    }\r\n};\r\n\r\nPartialCommandContext.prototype.steps = function(i) {\r\n    if(i===undefined) {\r\n        i = null;\r\n    }\r\n    if(i===null) {\r\n        return this.getTypedRuleContexts(StepsContext);\r\n    } else {\r\n        return this.getTypedRuleContext(StepsContext,i);\r\n    }\r\n};\r\n\r\nPartialCommandContext.prototype.curvature = function() {\r\n    return this.getTypedRuleContext(CurvatureContext,0);\r\n};\r\n\r\nPartialCommandContext.prototype.enterRule = function(listener) {\r\n    if(listener instanceof SketchListener ) {\r\n        listener.enterPartialCommand(this);\r\n\t}\r\n};\r\n\r\nPartialCommandContext.prototype.exitRule = function(listener) {\r\n    if(listener instanceof SketchListener ) {\r\n        listener.exitPartialCommand(this);\r\n\t}\r\n};\r\n\r\n\r\n\r\n\r\nSketchParser.PartialCommandContext = PartialCommandContext;\r\n\r\nSketchParser.prototype.partialCommand = function() {\r\n\r\n    var localctx = new PartialCommandContext(this, this._ctx, this.state);\r\n    this.enterRule(localctx, 22, SketchParser.RULE_partialCommand);\r\n    try {\r\n        this.enterOuterAlt(localctx, 1);\r\n        this.state = 109;\r\n        this.partialDirection();\r\n        this.state = 110;\r\n        this.steps();\r\n        this.state = 111;\r\n        this.partialDirection();\r\n        this.state = 112;\r\n        this.steps();\r\n        this.state = 115;\r\n        this._errHandler.sync(this);\r\n        var la_ = this._interp.adaptivePredict(this._input,14,this._ctx);\r\n        if(la_===1) {\r\n            this.state = 114;\r\n            this.curvature();\r\n\r\n        }\r\n    } catch (re) {\r\n    \tif(re instanceof antlr4.error.RecognitionException) {\r\n\t        localctx.exception = re;\r\n\t        this._errHandler.reportError(this, re);\r\n\t        this._errHandler.recover(this, re);\r\n\t    } else {\r\n\t    \tthrow re;\r\n\t    }\r\n    } finally {\r\n        this.exitRule();\r\n    }\r\n    return localctx;\r\n};\r\n\r\nfunction DirectionContext(parser, parent, invokingState) {\r\n\tif(parent===undefined) {\r\n\t    parent = null;\r\n\t}\r\n\tif(invokingState===undefined || invokingState===null) {\r\n\t\tinvokingState = -1;\r\n\t}\r\n\tantlr4.ParserRuleContext.call(this, parent, invokingState);\r\n    this.parser = parser;\r\n    this.ruleIndex = SketchParser.RULE_direction;\r\n    return this;\r\n}\r\n\r\nDirectionContext.prototype = Object.create(antlr4.ParserRuleContext.prototype);\r\nDirectionContext.prototype.constructor = DirectionContext;\r\n\r\nDirectionContext.prototype.DIRECTION = function() {\r\n    return this.getToken(SketchParser.DIRECTION, 0);\r\n};\r\n\r\nDirectionContext.prototype.enterRule = function(listener) {\r\n    if(listener instanceof SketchListener ) {\r\n        listener.enterDirection(this);\r\n\t}\r\n};\r\n\r\nDirectionContext.prototype.exitRule = function(listener) {\r\n    if(listener instanceof SketchListener ) {\r\n        listener.exitDirection(this);\r\n\t}\r\n};\r\n\r\n\r\n\r\n\r\nSketchParser.DirectionContext = DirectionContext;\r\n\r\nSketchParser.prototype.direction = function() {\r\n\r\n    var localctx = new DirectionContext(this, this._ctx, this.state);\r\n    this.enterRule(localctx, 24, SketchParser.RULE_direction);\r\n    try {\r\n        this.enterOuterAlt(localctx, 1);\r\n        this.state = 117;\r\n        this.match(SketchParser.DIRECTION);\r\n    } catch (re) {\r\n    \tif(re instanceof antlr4.error.RecognitionException) {\r\n\t        localctx.exception = re;\r\n\t        this._errHandler.reportError(this, re);\r\n\t        this._errHandler.recover(this, re);\r\n\t    } else {\r\n\t    \tthrow re;\r\n\t    }\r\n    } finally {\r\n        this.exitRule();\r\n    }\r\n    return localctx;\r\n};\r\n\r\nfunction PartialDirectionContext(parser, parent, invokingState) {\r\n\tif(parent===undefined) {\r\n\t    parent = null;\r\n\t}\r\n\tif(invokingState===undefined || invokingState===null) {\r\n\t\tinvokingState = -1;\r\n\t}\r\n\tantlr4.ParserRuleContext.call(this, parent, invokingState);\r\n    this.parser = parser;\r\n    this.ruleIndex = SketchParser.RULE_partialDirection;\r\n    return this;\r\n}\r\n\r\nPartialDirectionContext.prototype = Object.create(antlr4.ParserRuleContext.prototype);\r\nPartialDirectionContext.prototype.constructor = PartialDirectionContext;\r\n\r\nPartialDirectionContext.prototype.PARTIAL_DIRECTION = function() {\r\n    return this.getToken(SketchParser.PARTIAL_DIRECTION, 0);\r\n};\r\n\r\nPartialDirectionContext.prototype.enterRule = function(listener) {\r\n    if(listener instanceof SketchListener ) {\r\n        listener.enterPartialDirection(this);\r\n\t}\r\n};\r\n\r\nPartialDirectionContext.prototype.exitRule = function(listener) {\r\n    if(listener instanceof SketchListener ) {\r\n        listener.exitPartialDirection(this);\r\n\t}\r\n};\r\n\r\n\r\n\r\n\r\nSketchParser.PartialDirectionContext = PartialDirectionContext;\r\n\r\nSketchParser.prototype.partialDirection = function() {\r\n\r\n    var localctx = new PartialDirectionContext(this, this._ctx, this.state);\r\n    this.enterRule(localctx, 26, SketchParser.RULE_partialDirection);\r\n    try {\r\n        this.enterOuterAlt(localctx, 1);\r\n        this.state = 119;\r\n        this.match(SketchParser.PARTIAL_DIRECTION);\r\n    } catch (re) {\r\n    \tif(re instanceof antlr4.error.RecognitionException) {\r\n\t        localctx.exception = re;\r\n\t        this._errHandler.reportError(this, re);\r\n\t        this._errHandler.recover(this, re);\r\n\t    } else {\r\n\t    \tthrow re;\r\n\t    }\r\n    } finally {\r\n        this.exitRule();\r\n    }\r\n    return localctx;\r\n};\r\n\r\nfunction StepsContext(parser, parent, invokingState) {\r\n\tif(parent===undefined) {\r\n\t    parent = null;\r\n\t}\r\n\tif(invokingState===undefined || invokingState===null) {\r\n\t\tinvokingState = -1;\r\n\t}\r\n\tantlr4.ParserRuleContext.call(this, parent, invokingState);\r\n    this.parser = parser;\r\n    this.ruleIndex = SketchParser.RULE_steps;\r\n    return this;\r\n}\r\n\r\nStepsContext.prototype = Object.create(antlr4.ParserRuleContext.prototype);\r\nStepsContext.prototype.constructor = StepsContext;\r\n\r\nStepsContext.prototype.NUMBER = function() {\r\n    return this.getToken(SketchParser.NUMBER, 0);\r\n};\r\n\r\nStepsContext.prototype.enterRule = function(listener) {\r\n    if(listener instanceof SketchListener ) {\r\n        listener.enterSteps(this);\r\n\t}\r\n};\r\n\r\nStepsContext.prototype.exitRule = function(listener) {\r\n    if(listener instanceof SketchListener ) {\r\n        listener.exitSteps(this);\r\n\t}\r\n};\r\n\r\n\r\n\r\n\r\nSketchParser.StepsContext = StepsContext;\r\n\r\nSketchParser.prototype.steps = function() {\r\n\r\n    var localctx = new StepsContext(this, this._ctx, this.state);\r\n    this.enterRule(localctx, 28, SketchParser.RULE_steps);\r\n    try {\r\n        this.enterOuterAlt(localctx, 1);\r\n        this.state = 121;\r\n        this.match(SketchParser.NUMBER);\r\n    } catch (re) {\r\n    \tif(re instanceof antlr4.error.RecognitionException) {\r\n\t        localctx.exception = re;\r\n\t        this._errHandler.reportError(this, re);\r\n\t        this._errHandler.recover(this, re);\r\n\t    } else {\r\n\t    \tthrow re;\r\n\t    }\r\n    } finally {\r\n        this.exitRule();\r\n    }\r\n    return localctx;\r\n};\r\n\r\nfunction CurvatureContext(parser, parent, invokingState) {\r\n\tif(parent===undefined) {\r\n\t    parent = null;\r\n\t}\r\n\tif(invokingState===undefined || invokingState===null) {\r\n\t\tinvokingState = -1;\r\n\t}\r\n\tantlr4.ParserRuleContext.call(this, parent, invokingState);\r\n    this.parser = parser;\r\n    this.ruleIndex = SketchParser.RULE_curvature;\r\n    return this;\r\n}\r\n\r\nCurvatureContext.prototype = Object.create(antlr4.ParserRuleContext.prototype);\r\nCurvatureContext.prototype.constructor = CurvatureContext;\r\n\r\nCurvatureContext.prototype.CURVATURE = function() {\r\n    return this.getToken(SketchParser.CURVATURE, 0);\r\n};\r\n\r\nCurvatureContext.prototype.NUMBER = function() {\r\n    return this.getToken(SketchParser.NUMBER, 0);\r\n};\r\n\r\nCurvatureContext.prototype.enterRule = function(listener) {\r\n    if(listener instanceof SketchListener ) {\r\n        listener.enterCurvature(this);\r\n\t}\r\n};\r\n\r\nCurvatureContext.prototype.exitRule = function(listener) {\r\n    if(listener instanceof SketchListener ) {\r\n        listener.exitCurvature(this);\r\n\t}\r\n};\r\n\r\n\r\n\r\n\r\nSketchParser.CurvatureContext = CurvatureContext;\r\n\r\nSketchParser.prototype.curvature = function() {\r\n\r\n    var localctx = new CurvatureContext(this, this._ctx, this.state);\r\n    this.enterRule(localctx, 30, SketchParser.RULE_curvature);\r\n    try {\r\n        this.enterOuterAlt(localctx, 1);\r\n        this.state = 123;\r\n        this.match(SketchParser.CURVATURE);\r\n        this.state = 125;\r\n        this._errHandler.sync(this);\r\n        var la_ = this._interp.adaptivePredict(this._input,15,this._ctx);\r\n        if(la_===1) {\r\n            this.state = 124;\r\n            this.match(SketchParser.NUMBER);\r\n\r\n        }\r\n    } catch (re) {\r\n    \tif(re instanceof antlr4.error.RecognitionException) {\r\n\t        localctx.exception = re;\r\n\t        this._errHandler.reportError(this, re);\r\n\t        this._errHandler.recover(this, re);\r\n\t    } else {\r\n\t    \tthrow re;\r\n\t    }\r\n    } finally {\r\n        this.exitRule();\r\n    }\r\n    return localctx;\r\n};\r\n\r\n\r\nexports.SketchParser = SketchParser;\r\n","/* global $, paper, SC, Sketch, console */\r\n/* eslint-env browser */\r\n(function () {\r\n   'use strict';\r\n\r\n   /*\r\n   Copyright 2017 Government Software Assurance Corporation\r\n   Author: Chet Zema\r\n   \r\n   To rebuild the Lexer/Parser run ANTLR against Sketch.g4 on a machine with Java, use -Dlanguage=JavaScript\r\n   Copy SketchLexer.js, SketchParser.js, and SketchListener.js to this directory.\r\n   Run `npm run webpack` from UI directory.  This concatenates the antlr JS runtime, along with the Lexer/Parser and this listener implementation.  Output is wwwroot\\antlr.js\r\n   Include antlr.js in any webpage that needs to parse a sketch string.\r\n   \r\n   This listener must be kept in sync with \\RealEstate\\Calculation\\Sketch\\SketchProcessor.cs\r\n   \r\n   To use: SketchProcessor(sketchString) => { Array of Areas, Array of Errors }.  Each Area has an Array of Lines.\r\n   */\r\n\r\n   var antlr4 = require('antlr4/index');\r\n   var SketchLexer = require('./SketchLexer');\r\n   var SketchParser = require('./SketchParser');\r\n   var SketchListener = require('./SketchListener');\r\n\r\n   window.SketchProcessor = function (input) {\r\n      var errors = [];\r\n      SketchErrorListener.INSTANCE.initialize(errors);\r\n\r\n      var chars = new antlr4.InputStream(input);\r\n      var lexer = new SketchLexer.SketchLexer(chars);\r\n      lexer.addErrorListener(SketchErrorListener.INSTANCE);\r\n      var tokens = new antlr4.CommonTokenStream(lexer);\r\n      var parser = new SketchParser.SketchParser(tokens);\r\n      parser.addErrorListener(SketchErrorListener.INSTANCE);\r\n      var tree = parser.sketch();\r\n      var listener = new Listener(errors);\r\n      antlr4.tree.ParseTreeWalker.DEFAULT.walk(listener, tree);\r\n\r\n      return { areas: listener.GetAreas(), errors: errors };\r\n   };\r\n\r\n   // The actual listener that converts the AST into a usable data structure.\r\n   var Listener = function (errors) {\r\n      SketchListener.SketchListener.call(this);\r\n\r\n      this.errors = errors;\r\n      this.areas = [];\r\n      this.area_stack = [];\r\n      this.point_stack = [[0, 0]];\r\n\r\n      return this;\r\n   };\r\n\r\n   Listener.prototype = Object.create(SketchListener.SketchListener.prototype);\r\n   Listener.prototype.constructor = Listener;\r\n   Listener.prototype.GetAreas = function () {\r\n      return this.areas;\r\n   };\r\n\r\n   Listener.prototype.exitSketch = function (ctx) {\r\n      while (this.area_stack.length > 0) {\r\n         this.closeArea(this.area_stack.shift());\r\n      }\r\n   };\r\n\r\n   Listener.prototype.enterArea = function (ctx) {\r\n      var name = ctx.name().getText();\r\n\r\n      var area = {\r\n         cd: name,\r\n         lines: [],\r\n         data: {},\r\n         area_override: null,\r\n         centroid: [0, 0],\r\n         area_inches: 0,\r\n         perimeter_inches: 0,\r\n      };\r\n\r\n      this.areas.push(area);\r\n      this.area_stack.unshift(area);\r\n\r\n      if (ctx.NUMBER() !== null) {\r\n         area.area_override = parseInt(ctx.NUMBER().getText(), 10) * 144;\r\n      }\r\n\r\n      if (ctx.multiplier() != null) {\r\n         area.data.MULTIPLIER = parseInt(ctx.multiplier().NUMBER().getText(), 10);\r\n      }\r\n\r\n      // The point on the top of the stack is the current point for the current area.  It is modified as the area is traversed.\r\n      // Does it start at the last point, or does the area have an origin override?\r\n      var origin = ctx.origin();\r\n      var x = this.point_stack[0][0];\r\n      var y = this.point_stack[0][1];\r\n      if (origin !== null) {\r\n         x = this.toInches(origin.NUMBER()[0].getText());\r\n         y = this.toInches(origin.NUMBER()[1].getText());\r\n      }\r\n      this.point_stack.unshift([x, y]);\r\n   };\r\n\r\n   Listener.prototype.exitArea = function (ctx) {\r\n      this.closeArea(this.area_stack.shift());\r\n      this.point_stack.shift();\r\n   };\r\n\r\n   Listener.prototype.enterDatum = function (ctx) {\r\n      var name = ctx.name().getText().toUpperCase();\r\n      var val = ctx.data_val().getText();\r\n      var area = this.area_stack[0];\r\n\r\n      switch (name.toUpperCase()) {\r\n         case \"ORIG\":\r\n            var x = this.toInches(ctx.data_val().children[0].getText());\r\n            var y = this.toInches(ctx.data_val().children[2].getText());\r\n            this.point_stack[0] = [x, y];\r\n            break;\r\n         default:\r\n            area.data[name] = val;\r\n      }\r\n   };\r\n\r\n   Listener.prototype.enterCommand = function (ctx) {\r\n      var area = this.area_stack[0];\r\n      var point = this.point_stack[0];\r\n      var new_point = this.movePoint(point, ctx.direction().getText(), this.toInches(ctx.steps().getText()));\r\n      this.point_stack[0] = new_point;\r\n\r\n      var convex = false;\r\n      var centralAngle = null;\r\n\r\n      var curvature = ctx.curvature();\r\n      if (curvature !== null) {\r\n         convex = curvature.CURVATURE().getText().toUpperCase() === \"F\";\r\n\r\n         if (curvature.NUMBER() != null) {\r\n            centralAngle = parseInt(curvature.NUMBER().getText(), 10);\r\n         }\r\n      }\r\n\r\n      area.lines.push(this.createLine(point, this.point_stack[0], centralAngle, convex));\r\n   };\r\n\r\n   Listener.prototype.enterPartialCommand = function (ctx) {\r\n      var area = this.area_stack[0];\r\n      var point = this.point_stack[0];\r\n      var new_point = this.movePoint(point, ctx.partialDirection()[0].getText(), this.toInches(ctx.steps()[0].getText())); // Move the point based on the first command.\r\n      new_point = this.movePoint(new_point, ctx.partialDirection()[1].getText(), this.toInches(ctx.steps()[1].getText())); // Move the point again based on the second command.\r\n\r\n      this.point_stack[0] = new_point;\r\n\r\n      var convex = false;\r\n      var centralAngle = null;\r\n\r\n      var curvature = ctx.curvature();\r\n      if (curvature !== null) {\r\n         convex = curvature.CURVATURE().getText().toUpperCase() === \"F\";\r\n\r\n         if (curvature.NUMBER() != null) {\r\n            centralAngle = parseInt(curvature.NUMBER().getText(), 10);\r\n         }\r\n      }\r\n\r\n      area.lines.push(this.createLine(point, this.point_stack[0], centralAngle, convex));\r\n   };\r\n\r\n   Listener.prototype.movePoint = function (point, direction, distance) {\r\n      switch (direction.toUpperCase()) {\r\n         case \"N\": return [point[0], point[1] - distance];\r\n         case \"E\": return [point[0] + distance, point[1]];\r\n         case \"S\": return [point[0], point[1] + distance];\r\n         case \"W\": return [point[0] - distance, point[1]];\r\n         case \"U\": return [point[0], point[1] - distance];\r\n         case \"R\": return [point[0] + distance, point[1]];\r\n         case \"D\": return [point[0], point[1] + distance];\r\n         case \"L\": return [point[0] - distance, point[1]];\r\n      }\r\n\r\n      throw new Error(\"Unrecognized direction \\\"\" + direction + \"\\\".  Expecting N, E, S, W, U, R, D, or L.\");\r\n   };\r\n\r\n   Listener.prototype.createLine = function (start, end, centralAngle, convex) {\r\n      var line = {\r\n         start: start,\r\n         end: end,\r\n         centralAngle: centralAngle,\r\n         convex: convex,\r\n         CircleSegmentArea: 0,\r\n         Radius: 0\r\n      };\r\n\r\n      // Calculate the straight-line length.  This is the actual length for most lines, it is used as the basis of the radius for curved lines.\r\n      line.StraightLength = Math.abs(Math.sqrt(Math.pow(end[0] - start[0], 2) + Math.pow(end[1] - start[1], 2)));\r\n      line.Textpoint = [(start[0] + end[0]) / 2, (start[1] + end[1]) / 2];\r\n\r\n      // Calculate and cache the curved length and circle segment area, if needed.\r\n      if (centralAngle !== null && centralAngle !== 0) {\r\n         var theta = Math.PI * centralAngle / 180.0; // Convert central angle to radians.\r\n         line.Radius = line.StraightLength / (2 * Math.sin(theta / 2));\r\n\r\n         // Now that we know the radius, we can get the length arc, from there get the length of the line.  Circumfrence of circle divided by the portion covered by the arc.\r\n         line.Length = (Math.PI * 2 * line.Radius) * (theta / (Math.PI * 2));\r\n\r\n         // Calculate the area as total area of circle less the portion not contained in the arc.\r\n         var A = Math.abs(0.5 * Math.pow(line.Radius, 2) * (theta - Math.sin(theta)));\r\n\r\n         // Convex curves increase the area.  Concave curves decrease the area.\r\n         line.CircleSegmentArea = convex ? -A : A;\r\n\r\n         var cx = null;\r\n         var cy = null;\r\n         var dist = line.StraightLength;\r\n         var radius = line.Radius;\r\n         var startAngle = null;\r\n         var midAngle = null;\r\n         var endAngle = null;\r\n         var convex = line.convex === (centralAngle > 180 ? false : true); // If central angle is >180 then swap treat convex as concave and vis versa.\r\n\r\n         if (line.Radius !== 0) {\r\n            // Calculate the circle center point.\r\n            // Right now, the midpoint is the textpoint.\r\n            var mx = line.Textpoint[0];\r\n            var my = line.Textpoint[1];\r\n            var yDist = Math.sqrt(Math.pow(line.Radius, 2) - Math.pow(dist / 2, 2)); // Length of line perpendicular to straight-line between points.\r\n\r\n            if (convex) {\r\n               // Convex\r\n               cx = mx - yDist * (start[1] - end[1]) / dist;\r\n               cy = my - yDist * (end[0] - start[0]) / dist;\r\n            } else {\r\n               // Concave\r\n               cx = mx + yDist * (start[1] - end[1]) / dist;\r\n               cy = my + yDist * (end[0] - start[0]) / dist;\r\n            }\r\n\r\n            startAngle = Math.atan2(end[1] - cy, end[0] - cx);\r\n            midAngle = Math.atan2(my - cy, mx - cx);\r\n            endAngle = Math.atan2(start[1] - cy, start[0] - cx);\r\n\r\n            if (startAngle < 0) startAngle += Math.PI * 2;\r\n            if (midAngle < 0) midAngle += Math.PI * 2;\r\n            if (endAngle < 0) endAngle += Math.PI * 2;\r\n\r\n            // Get the position for the text, it is not on the midpoint when dealing with curves.\r\n            var tx = cx + (radius * Math.cos(midAngle));\r\n            var ty = cy + (radius * Math.sin(midAngle));\r\n\r\n            // If the angle is greater than 180 then it is inverted.\r\n            if (convex && !line.convex) {\r\n               tx = cx - (radius * Math.cos(midAngle));\r\n               ty = cy - (radius * Math.sin(midAngle));\r\n            } else if (!convex && line.convex) {\r\n               tx = cx - (radius * Math.cos(midAngle));\r\n               ty = cy - (radius * Math.sin(midAngle));\r\n            }\r\n\r\n            // Swap the start and end angles if concave.\r\n            if (!line.convex) {\r\n               var temp = startAngle;\r\n               startAngle = endAngle;\r\n               endAngle = temp;\r\n            }\r\n\r\n            line.StartAngle = startAngle;\r\n            line.EndAngle = endAngle;\r\n            line.Centerpoint = [cx, cy];\r\n            line.Textpoint = [tx, ty]; // Change the textpoint because the text will appear along the arc.\r\n         }\r\n      } else {\r\n         line.Length = line.StraightLength;\r\n      }\r\n\r\n      return line;\r\n   };\r\n\r\n   Listener.prototype.closeArea = function (area) {\r\n      if (area.lines.length > 1) {\r\n         // Does the area first point match the last point?\r\n         var start = area.lines[0].start;\r\n         var end = area.lines[area.lines.length - 1].end;\r\n         if (start[0] !== end[0] || start[1] !== end[1]) {\r\n            this.errors.push('Area ' + area.cd + ' is not closed.');\r\n         }\r\n\r\n         // Calculate the area's centroid, area, and perimeter.\r\n         var areaPrime = 0;\r\n         var centroidPrimeX = 0;\r\n         var centroidPrimeY = 0;\r\n         var perimeter = 0;\r\n\r\n         // Notice: Do not scan the last point.\r\n         for (var i = 0; i < area.lines.length; i++) {\r\n            var line = area.lines[i];\r\n\r\n            var p1, p2;\r\n\r\n            // For added precision with circle areas, go from the start to TextPoint then from TextPoint to end.\r\n            for (var j = 0; j < 2; j++) {\r\n               if (j == 0) {\r\n                  p1 = line.start;\r\n                  p2 = line.Textpoint;\r\n               } else {\r\n                  p1 = line.Textpoint;\r\n                  p2 = line.end;\r\n               }\r\n\r\n               var normalizer = (p1[0] * p2[1]) - (p2[0] * p1[1]); // This normalizer is part of the area and the centroid calculation.\r\n               areaPrime += normalizer;\r\n               //areaPrime += 2 * line.CircleSegmentArea; // Multiply by two, since we will be dividing by two.\r\n               centroidPrimeX += (p1[0] + p2[0]) * normalizer;\r\n               centroidPrimeY += (p1[1] + p2[1]) * normalizer;\r\n            }\r\n\r\n            perimeter += line.Length;\r\n         }\r\n\r\n         var sqFt = 0.5 * areaPrime;\r\n         var centroidNormalizer = 1 / (6 * sqFt);\r\n         var centroidX = centroidPrimeX * centroidNormalizer;\r\n         var centroidY = centroidPrimeY * centroidNormalizer;\r\n\r\n         area.area_inches = Math.round(Math.abs(sqFt), 0);\r\n         area.centroid = [centroidX, centroidY];\r\n         area.perimeter_inches = Math.round(perimeter, 0);\r\n      }\r\n   };\r\n\r\n   Listener.prototype.toInches = function (ft) {\r\n      // The fractional part is in 12ths, not tenths.\r\n      // Basically it is feet.inches where inches is between 0 and 11.\r\n      var vals = ft.split('.');\r\n      var px = parseFloat(vals[0]) * 12;\r\n      if (vals.length > 1) {\r\n         if (px < 0) {\r\n            px -= parseFloat(vals[1]);\r\n         } else {\r\n            px += parseFloat(vals[1]);\r\n         }\r\n      }\r\n\r\n      return px;\r\n   };\r\n\r\n   function SketchErrorListener() {\r\n      antlr4.error.ErrorListener.call(this);\r\n      return this;\r\n   };\r\n\r\n   SketchErrorListener.prototype = Object.create(antlr4.error.ErrorListener.prototype);\r\n   SketchErrorListener.prototype.constructor = SketchErrorListener;\r\n   SketchErrorListener.INSTANCE = new SketchErrorListener();\r\n\r\n   SketchErrorListener.prototype.syntaxError = function (recognizer, offendingSymbol, line, column, msg, e) {\r\n      this.errors.push(\"line \" + line + \":\" + column + \" \" + msg);\r\n   };\r\n\r\n   SketchErrorListener.prototype.initialize = function (errors) {\r\n      this.errors = errors;\r\n   };\r\n\r\n}());"],"sourceRoot":""}