UNPKG

ifc-expressions

Version:

Parsing and evaluation of IFC expressions

1,258 lines (1,257 loc) 65.2 kB
"use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.VariableRefContext = exports.LogicalLiteralContext = exports.BooleanLiteralContext = exports.StringLiteralContext = exports.NumLiteralContext = exports.LiteralContext = exports.ArrayElementListContext = exports.ArrayExprContext = exports.ExprListContext = exports.FunctionCallContext = exports.MethodPropertyAccessContext = exports.MethodFunctionCallContext = exports.MethodAccessorContext = exports.MethodCallChainEndContext = exports.MethodCallChainInnerContext = exports.MethodCallChainContext = exports.SEMethodCallContext = exports.SEBooleanBinaryOpContext = exports.SEComparisonContext = exports.SEAddSubContext = exports.SEMulDivContext = exports.SEPowerContext = exports.SEArrayExprContext = exports.SELiteralContext = exports.SEFunctionCallContext = exports.SEVariableRefContext = exports.SENotContext = exports.SEUnaryMinusContext = exports.SEParenthesisContext = exports.SEUnaryMultipleMinusContext = exports.SingleExprContext = exports.ExprContext = exports.IfcExpressionParser = void 0; const antlr = __importStar(require("antlr4ng")); class IfcExpressionParser extends antlr.Parser { get grammarFileName() { return "IfcExpression.g4"; } get literalNames() { return IfcExpressionParser.literalNames; } get symbolicNames() { return IfcExpressionParser.symbolicNames; } get ruleNames() { return IfcExpressionParser.ruleNames; } get serializedATN() { return IfcExpressionParser._serializedATN; } createFailedPredicateException(predicate, message) { return new antlr.FailedPredicateException(this, predicate, message); } constructor(input) { super(input); this.interpreter = new antlr.ParserATNSimulator(this, IfcExpressionParser._ATN, IfcExpressionParser.decisionsToDFA, new antlr.PredictionContextCache()); } expr() { let localContext = new ExprContext(this.context, this.state); this.enterRule(localContext, 0, IfcExpressionParser.RULE_expr); try { this.enterOuterAlt(localContext, 1); { this.state = 28; this.singleExpr(0); this.state = 29; this.match(IfcExpressionParser.EOF); } } catch (re) { if (re instanceof antlr.RecognitionException) { this.errorHandler.reportError(this, re); this.errorHandler.recover(this, re); } else { throw re; } } finally { this.exitRule(); } return localContext; } singleExpr(_p) { if (_p === undefined) { _p = 0; } let parentContext = this.context; let parentState = this.state; let localContext = new SingleExprContext(this.context, parentState); let previousContext = localContext; let _startState = 2; this.enterRecursionRule(localContext, 2, IfcExpressionParser.RULE_singleExpr, _p); let _la; try { let alternative; this.enterOuterAlt(localContext, 1); { this.state = 46; this.errorHandler.sync(this); switch (this.tokenStream.LA(1)) { case IfcExpressionParser.T__0: { localContext = new SEUnaryMultipleMinusContext(localContext); this.context = localContext; previousContext = localContext; this.state = 32; this.match(IfcExpressionParser.T__0); this.state = 33; localContext._sub = this.singleExpr(14); } break; case IfcExpressionParser.T__1: { localContext = new SEParenthesisContext(localContext); this.context = localContext; previousContext = localContext; this.state = 34; this.match(IfcExpressionParser.T__1); this.state = 35; localContext._sub = this.singleExpr(0); this.state = 36; this.match(IfcExpressionParser.T__2); } break; case IfcExpressionParser.T__3: { localContext = new SEUnaryMinusContext(localContext); this.context = localContext; previousContext = localContext; this.state = 38; this.match(IfcExpressionParser.T__3); this.state = 39; localContext._sub = this.singleExpr(12); } break; case IfcExpressionParser.T__8: { localContext = new SENotContext(localContext); this.context = localContext; previousContext = localContext; this.state = 40; this.match(IfcExpressionParser.T__8); this.state = 41; localContext._sub = this.singleExpr(6); } break; case IfcExpressionParser.T__12: { localContext = new SEVariableRefContext(localContext); this.context = localContext; previousContext = localContext; this.state = 42; localContext._sub = this.variableRef(); } break; case IfcExpressionParser.IDENTIFIER: { localContext = new SEFunctionCallContext(localContext); this.context = localContext; previousContext = localContext; this.state = 43; localContext._sub = this.functionCall(); } break; case IfcExpressionParser.INT: case IfcExpressionParser.FLOAT: case IfcExpressionParser.BOOLEAN: case IfcExpressionParser.LOGICAL_UNKNOWN: case IfcExpressionParser.QUOTED_STRING: { localContext = new SELiteralContext(localContext); this.context = localContext; previousContext = localContext; this.state = 44; localContext._sub = this.literal(); } break; case IfcExpressionParser.T__10: { localContext = new SEArrayExprContext(localContext); this.context = localContext; previousContext = localContext; this.state = 45; localContext._sub = this.arrayExpr(); } break; default: throw new antlr.NoViableAltException(this); } this.context.stop = this.tokenStream.LT(-1); this.state = 67; this.errorHandler.sync(this); alternative = this.interpreter.adaptivePredict(this.tokenStream, 2, this.context); while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { if (alternative === 1) { if (this.parseListeners != null) { this.triggerExitRuleEvent(); } previousContext = localContext; { this.state = 65; this.errorHandler.sync(this); switch (this.interpreter.adaptivePredict(this.tokenStream, 1, this.context)) { case 1: { localContext = new SEPowerContext(new SingleExprContext(parentContext, parentState)); localContext._left = previousContext; this.pushNewRecursionContext(localContext, _startState, IfcExpressionParser.RULE_singleExpr); this.state = 48; if (!(this.precpred(this.context, 11))) { throw this.createFailedPredicateException("this.precpred(this.context, 11)"); } this.state = 49; localContext._op = this.match(IfcExpressionParser.T__4); this.state = 50; localContext._right = this.singleExpr(11); } break; case 2: { localContext = new SEMulDivContext(new SingleExprContext(parentContext, parentState)); localContext._left = previousContext; this.pushNewRecursionContext(localContext, _startState, IfcExpressionParser.RULE_singleExpr); this.state = 51; if (!(this.precpred(this.context, 9))) { throw this.createFailedPredicateException("this.precpred(this.context, 9)"); } this.state = 52; localContext._op = this.tokenStream.LT(1); _la = this.tokenStream.LA(1); if (!(_la === 6 || _la === 7)) { localContext._op = this.errorHandler.recoverInline(this); } else { this.errorHandler.reportMatch(this); this.consume(); } this.state = 53; localContext._right = this.singleExpr(10); } break; case 3: { localContext = new SEAddSubContext(new SingleExprContext(parentContext, parentState)); localContext._left = previousContext; this.pushNewRecursionContext(localContext, _startState, IfcExpressionParser.RULE_singleExpr); this.state = 54; if (!(this.precpred(this.context, 8))) { throw this.createFailedPredicateException("this.precpred(this.context, 8)"); } this.state = 55; localContext._op = this.tokenStream.LT(1); _la = this.tokenStream.LA(1); if (!(_la === 4 || _la === 8)) { localContext._op = this.errorHandler.recoverInline(this); } else { this.errorHandler.reportMatch(this); this.consume(); } this.state = 56; localContext._right = this.singleExpr(9); } break; case 4: { localContext = new SEComparisonContext(new SingleExprContext(parentContext, parentState)); localContext._left = previousContext; this.pushNewRecursionContext(localContext, _startState, IfcExpressionParser.RULE_singleExpr); this.state = 57; if (!(this.precpred(this.context, 7))) { throw this.createFailedPredicateException("this.precpred(this.context, 7)"); } this.state = 58; this.match(IfcExpressionParser.CMP_OP); this.state = 59; localContext._right = this.singleExpr(8); } break; case 5: { localContext = new SEBooleanBinaryOpContext(new SingleExprContext(parentContext, parentState)); localContext._left = previousContext; this.pushNewRecursionContext(localContext, _startState, IfcExpressionParser.RULE_singleExpr); this.state = 60; if (!(this.precpred(this.context, 5))) { throw this.createFailedPredicateException("this.precpred(this.context, 5)"); } this.state = 61; localContext._op = this.match(IfcExpressionParser.BOOLEAN_BINARY_OP); this.state = 62; localContext._right = this.singleExpr(6); } break; case 6: { localContext = new SEMethodCallContext(new SingleExprContext(parentContext, parentState)); localContext._target = previousContext; this.pushNewRecursionContext(localContext, _startState, IfcExpressionParser.RULE_singleExpr); this.state = 63; if (!(this.precpred(this.context, 10))) { throw this.createFailedPredicateException("this.precpred(this.context, 10)"); } this.state = 64; localContext._call = this.methodCallChain(); } break; } } } this.state = 69; this.errorHandler.sync(this); alternative = this.interpreter.adaptivePredict(this.tokenStream, 2, this.context); } } } catch (re) { if (re instanceof antlr.RecognitionException) { this.errorHandler.reportError(this, re); this.errorHandler.recover(this, re); } else { throw re; } } finally { this.unrollRecursionContexts(parentContext); } return localContext; } methodCallChain() { let localContext = new MethodCallChainContext(this.context, this.state); this.enterRule(localContext, 4, IfcExpressionParser.RULE_methodCallChain); try { this.state = 76; this.errorHandler.sync(this); switch (this.interpreter.adaptivePredict(this.tokenStream, 3, this.context)) { case 1: localContext = new MethodCallChainInnerContext(localContext); this.enterOuterAlt(localContext, 1); { this.state = 70; this.match(IfcExpressionParser.DOT); this.state = 71; localContext._target = this.methodAccessor(); this.state = 72; localContext._call = this.methodCallChain(); } break; case 2: localContext = new MethodCallChainEndContext(localContext); this.enterOuterAlt(localContext, 2); { this.state = 74; this.match(IfcExpressionParser.DOT); this.state = 75; localContext._call = this.methodAccessor(); } break; } } catch (re) { if (re instanceof antlr.RecognitionException) { this.errorHandler.reportError(this, re); this.errorHandler.recover(this, re); } else { throw re; } } finally { this.exitRule(); } return localContext; } methodAccessor() { let localContext = new MethodAccessorContext(this.context, this.state); this.enterRule(localContext, 6, IfcExpressionParser.RULE_methodAccessor); try { this.state = 80; this.errorHandler.sync(this); switch (this.interpreter.adaptivePredict(this.tokenStream, 4, this.context)) { case 1: localContext = new MethodFunctionCallContext(localContext); this.enterOuterAlt(localContext, 1); { this.state = 78; this.functionCall(); } break; case 2: localContext = new MethodPropertyAccessContext(localContext); this.enterOuterAlt(localContext, 2); { this.state = 79; this.match(IfcExpressionParser.IDENTIFIER); } break; } } catch (re) { if (re instanceof antlr.RecognitionException) { this.errorHandler.reportError(this, re); this.errorHandler.recover(this, re); } else { throw re; } } finally { this.exitRule(); } return localContext; } functionCall() { let localContext = new FunctionCallContext(this.context, this.state); this.enterRule(localContext, 8, IfcExpressionParser.RULE_functionCall); let _la; try { this.enterOuterAlt(localContext, 1); { this.state = 82; this.match(IfcExpressionParser.IDENTIFIER); this.state = 83; this.match(IfcExpressionParser.T__1); this.state = 85; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); if ((((_la) & ~0x1F) === 0 && ((1 << _la) & 1829398) !== 0)) { { this.state = 84; localContext._sub = this.exprList(); } } this.state = 87; this.match(IfcExpressionParser.T__2); } } catch (re) { if (re instanceof antlr.RecognitionException) { this.errorHandler.reportError(this, re); this.errorHandler.recover(this, re); } else { throw re; } } finally { this.exitRule(); } return localContext; } exprList() { let localContext = new ExprListContext(this.context, this.state); this.enterRule(localContext, 10, IfcExpressionParser.RULE_exprList); try { this.state = 94; this.errorHandler.sync(this); switch (this.interpreter.adaptivePredict(this.tokenStream, 6, this.context)) { case 1: this.enterOuterAlt(localContext, 1); { this.state = 89; this.singleExpr(0); } break; case 2: this.enterOuterAlt(localContext, 2); { this.state = 90; this.singleExpr(0); this.state = 91; this.match(IfcExpressionParser.T__9); this.state = 92; this.exprList(); } break; } } catch (re) { if (re instanceof antlr.RecognitionException) { this.errorHandler.reportError(this, re); this.errorHandler.recover(this, re); } else { throw re; } } finally { this.exitRule(); } return localContext; } arrayExpr() { let localContext = new ArrayExprContext(this.context, this.state); this.enterRule(localContext, 12, IfcExpressionParser.RULE_arrayExpr); let _la; try { this.enterOuterAlt(localContext, 1); { this.state = 96; this.match(IfcExpressionParser.T__10); this.state = 98; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); if ((((_la) & ~0x1F) === 0 && ((1 << _la) & 1829398) !== 0)) { { this.state = 97; localContext._sub = this.arrayElementList(); } } this.state = 100; this.match(IfcExpressionParser.T__11); } } catch (re) { if (re instanceof antlr.RecognitionException) { this.errorHandler.reportError(this, re); this.errorHandler.recover(this, re); } else { throw re; } } finally { this.exitRule(); } return localContext; } arrayElementList() { let localContext = new ArrayElementListContext(this.context, this.state); this.enterRule(localContext, 14, IfcExpressionParser.RULE_arrayElementList); try { this.state = 107; this.errorHandler.sync(this); switch (this.interpreter.adaptivePredict(this.tokenStream, 8, this.context)) { case 1: this.enterOuterAlt(localContext, 1); { this.state = 102; this.singleExpr(0); } break; case 2: this.enterOuterAlt(localContext, 2); { this.state = 103; this.singleExpr(0); this.state = 104; this.match(IfcExpressionParser.T__9); this.state = 105; this.arrayElementList(); } break; } } catch (re) { if (re instanceof antlr.RecognitionException) { this.errorHandler.reportError(this, re); this.errorHandler.recover(this, re); } else { throw re; } } finally { this.exitRule(); } return localContext; } literal() { let localContext = new LiteralContext(this.context, this.state); this.enterRule(localContext, 16, IfcExpressionParser.RULE_literal); try { this.state = 113; this.errorHandler.sync(this); switch (this.tokenStream.LA(1)) { case IfcExpressionParser.INT: case IfcExpressionParser.FLOAT: this.enterOuterAlt(localContext, 1); { this.state = 109; this.numLiteral(); } break; case IfcExpressionParser.QUOTED_STRING: this.enterOuterAlt(localContext, 2); { this.state = 110; this.stringLiteral(); } break; case IfcExpressionParser.BOOLEAN: this.enterOuterAlt(localContext, 3); { this.state = 111; this.booleanLiteral(); } break; case IfcExpressionParser.LOGICAL_UNKNOWN: this.enterOuterAlt(localContext, 4); { this.state = 112; this.logicalLiteral(); } break; default: throw new antlr.NoViableAltException(this); } } catch (re) { if (re instanceof antlr.RecognitionException) { this.errorHandler.reportError(this, re); this.errorHandler.recover(this, re); } else { throw re; } } finally { this.exitRule(); } return localContext; } numLiteral() { let localContext = new NumLiteralContext(this.context, this.state); this.enterRule(localContext, 18, IfcExpressionParser.RULE_numLiteral); let _la; try { this.enterOuterAlt(localContext, 1); { this.state = 115; _la = this.tokenStream.LA(1); if (!(_la === 14 || _la === 15)) { this.errorHandler.recoverInline(this); } else { this.errorHandler.reportMatch(this); this.consume(); } } } catch (re) { if (re instanceof antlr.RecognitionException) { this.errorHandler.reportError(this, re); this.errorHandler.recover(this, re); } else { throw re; } } finally { this.exitRule(); } return localContext; } stringLiteral() { let localContext = new StringLiteralContext(this.context, this.state); this.enterRule(localContext, 20, IfcExpressionParser.RULE_stringLiteral); try { this.enterOuterAlt(localContext, 1); { this.state = 117; this.match(IfcExpressionParser.QUOTED_STRING); } } catch (re) { if (re instanceof antlr.RecognitionException) { this.errorHandler.reportError(this, re); this.errorHandler.recover(this, re); } else { throw re; } } finally { this.exitRule(); } return localContext; } booleanLiteral() { let localContext = new BooleanLiteralContext(this.context, this.state); this.enterRule(localContext, 22, IfcExpressionParser.RULE_booleanLiteral); try { this.enterOuterAlt(localContext, 1); { this.state = 119; this.match(IfcExpressionParser.BOOLEAN); } } catch (re) { if (re instanceof antlr.RecognitionException) { this.errorHandler.reportError(this, re); this.errorHandler.recover(this, re); } else { throw re; } } finally { this.exitRule(); } return localContext; } logicalLiteral() { let localContext = new LogicalLiteralContext(this.context, this.state); this.enterRule(localContext, 24, IfcExpressionParser.RULE_logicalLiteral); try { this.enterOuterAlt(localContext, 1); { this.state = 121; this.match(IfcExpressionParser.LOGICAL_UNKNOWN); } } catch (re) { if (re instanceof antlr.RecognitionException) { this.errorHandler.reportError(this, re); this.errorHandler.recover(this, re); } else { throw re; } } finally { this.exitRule(); } return localContext; } variableRef() { let localContext = new VariableRefContext(this.context, this.state); this.enterRule(localContext, 26, IfcExpressionParser.RULE_variableRef); try { this.enterOuterAlt(localContext, 1); { this.state = 123; this.match(IfcExpressionParser.T__12); this.state = 124; this.match(IfcExpressionParser.IDENTIFIER); } } catch (re) { if (re instanceof antlr.RecognitionException) { this.errorHandler.reportError(this, re); this.errorHandler.recover(this, re); } else { throw re; } } finally { this.exitRule(); } return localContext; } sempred(localContext, ruleIndex, predIndex) { switch (ruleIndex) { case 1: return this.singleExpr_sempred(localContext, predIndex); } return true; } singleExpr_sempred(localContext, predIndex) { switch (predIndex) { case 0: return this.precpred(this.context, 11); case 1: return this.precpred(this.context, 9); case 2: return this.precpred(this.context, 8); case 3: return this.precpred(this.context, 7); case 4: return this.precpred(this.context, 5); case 5: return this.precpred(this.context, 10); } return true; } static get _ATN() { if (!IfcExpressionParser.__ATN) { IfcExpressionParser.__ATN = new antlr.ATNDeserializer().deserialize(IfcExpressionParser._serializedATN); } return IfcExpressionParser.__ATN; } get vocabulary() { return IfcExpressionParser.vocabulary; } } exports.IfcExpressionParser = IfcExpressionParser; IfcExpressionParser.T__0 = 1; IfcExpressionParser.T__1 = 2; IfcExpressionParser.T__2 = 3; IfcExpressionParser.T__3 = 4; IfcExpressionParser.T__4 = 5; IfcExpressionParser.T__5 = 6; IfcExpressionParser.T__6 = 7; IfcExpressionParser.T__7 = 8; IfcExpressionParser.T__8 = 9; IfcExpressionParser.T__9 = 10; IfcExpressionParser.T__10 = 11; IfcExpressionParser.T__11 = 12; IfcExpressionParser.T__12 = 13; IfcExpressionParser.INT = 14; IfcExpressionParser.FLOAT = 15; IfcExpressionParser.BOOLEAN = 16; IfcExpressionParser.LOGICAL_UNKNOWN = 17; IfcExpressionParser.DOT = 18; IfcExpressionParser.QUOTED_STRING = 19; IfcExpressionParser.IDENTIFIER = 20; IfcExpressionParser.WS = 21; IfcExpressionParser.NEWLINE = 22; IfcExpressionParser.BOOLEAN_BINARY_OP = 23; IfcExpressionParser.CMP_OP = 24; IfcExpressionParser.RULE_expr = 0; IfcExpressionParser.RULE_singleExpr = 1; IfcExpressionParser.RULE_methodCallChain = 2; IfcExpressionParser.RULE_methodAccessor = 3; IfcExpressionParser.RULE_functionCall = 4; IfcExpressionParser.RULE_exprList = 5; IfcExpressionParser.RULE_arrayExpr = 6; IfcExpressionParser.RULE_arrayElementList = 7; IfcExpressionParser.RULE_literal = 8; IfcExpressionParser.RULE_numLiteral = 9; IfcExpressionParser.RULE_stringLiteral = 10; IfcExpressionParser.RULE_booleanLiteral = 11; IfcExpressionParser.RULE_logicalLiteral = 12; IfcExpressionParser.RULE_variableRef = 13; IfcExpressionParser.literalNames = [ null, "'--'", "'('", "')'", "'-'", "'^'", "'*'", "'/'", "'+'", "'!'", "','", "'['", "']'", "'$'", null, null, null, null, "'.'" ]; IfcExpressionParser.symbolicNames = [ null, null, null, null, null, null, null, null, null, null, null, null, null, null, "INT", "FLOAT", "BOOLEAN", "LOGICAL_UNKNOWN", "DOT", "QUOTED_STRING", "IDENTIFIER", "WS", "NEWLINE", "BOOLEAN_BINARY_OP", "CMP_OP" ]; IfcExpressionParser.ruleNames = [ "expr", "singleExpr", "methodCallChain", "methodAccessor", "functionCall", "exprList", "arrayExpr", "arrayElementList", "literal", "numLiteral", "stringLiteral", "booleanLiteral", "logicalLiteral", "variableRef", ]; IfcExpressionParser._serializedATN = [ 4, 1, 24, 127, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 47, 8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 1, 66, 8, 1, 10, 1, 12, 1, 69, 9, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 77, 8, 2, 1, 3, 1, 3, 3, 3, 81, 8, 3, 1, 4, 1, 4, 1, 4, 3, 4, 86, 8, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 95, 8, 5, 1, 6, 1, 6, 3, 6, 99, 8, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 3, 7, 108, 8, 7, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 114, 8, 8, 1, 9, 1, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 0, 1, 2, 14, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 0, 3, 1, 0, 6, 7, 2, 0, 4, 4, 8, 8, 1, 0, 14, 15, 134, 0, 28, 1, 0, 0, 0, 2, 46, 1, 0, 0, 0, 4, 76, 1, 0, 0, 0, 6, 80, 1, 0, 0, 0, 8, 82, 1, 0, 0, 0, 10, 94, 1, 0, 0, 0, 12, 96, 1, 0, 0, 0, 14, 107, 1, 0, 0, 0, 16, 113, 1, 0, 0, 0, 18, 115, 1, 0, 0, 0, 20, 117, 1, 0, 0, 0, 22, 119, 1, 0, 0, 0, 24, 121, 1, 0, 0, 0, 26, 123, 1, 0, 0, 0, 28, 29, 3, 2, 1, 0, 29, 30, 5, 0, 0, 1, 30, 1, 1, 0, 0, 0, 31, 32, 6, 1, -1, 0, 32, 33, 5, 1, 0, 0, 33, 47, 3, 2, 1, 14, 34, 35, 5, 2, 0, 0, 35, 36, 3, 2, 1, 0, 36, 37, 5, 3, 0, 0, 37, 47, 1, 0, 0, 0, 38, 39, 5, 4, 0, 0, 39, 47, 3, 2, 1, 12, 40, 41, 5, 9, 0, 0, 41, 47, 3, 2, 1, 6, 42, 47, 3, 26, 13, 0, 43, 47, 3, 8, 4, 0, 44, 47, 3, 16, 8, 0, 45, 47, 3, 12, 6, 0, 46, 31, 1, 0, 0, 0, 46, 34, 1, 0, 0, 0, 46, 38, 1, 0, 0, 0, 46, 40, 1, 0, 0, 0, 46, 42, 1, 0, 0, 0, 46, 43, 1, 0, 0, 0, 46, 44, 1, 0, 0, 0, 46, 45, 1, 0, 0, 0, 47, 67, 1, 0, 0, 0, 48, 49, 10, 11, 0, 0, 49, 50, 5, 5, 0, 0, 50, 66, 3, 2, 1, 11, 51, 52, 10, 9, 0, 0, 52, 53, 7, 0, 0, 0, 53, 66, 3, 2, 1, 10, 54, 55, 10, 8, 0, 0, 55, 56, 7, 1, 0, 0, 56, 66, 3, 2, 1, 9, 57, 58, 10, 7, 0, 0, 58, 59, 5, 24, 0, 0, 59, 66, 3, 2, 1, 8, 60, 61, 10, 5, 0, 0, 61, 62, 5, 23, 0, 0, 62, 66, 3, 2, 1, 6, 63, 64, 10, 10, 0, 0, 64, 66, 3, 4, 2, 0, 65, 48, 1, 0, 0, 0, 65, 51, 1, 0, 0, 0, 65, 54, 1, 0, 0, 0, 65, 57, 1, 0, 0, 0, 65, 60, 1, 0, 0, 0, 65, 63, 1, 0, 0, 0, 66, 69, 1, 0, 0, 0, 67, 65, 1, 0, 0, 0, 67, 68, 1, 0, 0, 0, 68, 3, 1, 0, 0, 0, 69, 67, 1, 0, 0, 0, 70, 71, 5, 18, 0, 0, 71, 72, 3, 6, 3, 0, 72, 73, 3, 4, 2, 0, 73, 77, 1, 0, 0, 0, 74, 75, 5, 18, 0, 0, 75, 77, 3, 6, 3, 0, 76, 70, 1, 0, 0, 0, 76, 74, 1, 0, 0, 0, 77, 5, 1, 0, 0, 0, 78, 81, 3, 8, 4, 0, 79, 81, 5, 20, 0, 0, 80, 78, 1, 0, 0, 0, 80, 79, 1, 0, 0, 0, 81, 7, 1, 0, 0, 0, 82, 83, 5, 20, 0, 0, 83, 85, 5, 2, 0, 0, 84, 86, 3, 10, 5, 0, 85, 84, 1, 0, 0, 0, 85, 86, 1, 0, 0, 0, 86, 87, 1, 0, 0, 0, 87, 88, 5, 3, 0, 0, 88, 9, 1, 0, 0, 0, 89, 95, 3, 2, 1, 0, 90, 91, 3, 2, 1, 0, 91, 92, 5, 10, 0, 0, 92, 93, 3, 10, 5, 0, 93, 95, 1, 0, 0, 0, 94, 89, 1, 0, 0, 0, 94, 90, 1, 0, 0, 0, 95, 11, 1, 0, 0, 0, 96, 98, 5, 11, 0, 0, 97, 99, 3, 14, 7, 0, 98, 97, 1, 0, 0, 0, 98, 99, 1, 0, 0, 0, 99, 100, 1, 0, 0, 0, 100, 101, 5, 12, 0, 0, 101, 13, 1, 0, 0, 0, 102, 108, 3, 2, 1, 0, 103, 104, 3, 2, 1, 0, 104, 105, 5, 10, 0, 0, 105, 106, 3, 14, 7, 0, 106, 108, 1, 0, 0, 0, 107, 102, 1, 0, 0, 0, 107, 103, 1, 0, 0, 0, 108, 15, 1, 0, 0, 0, 109, 114, 3, 18, 9, 0, 110, 114, 3, 20, 10, 0, 111, 114, 3, 22, 11, 0, 112, 114, 3, 24, 12, 0, 113, 109, 1, 0, 0, 0, 113, 110, 1, 0, 0, 0, 113, 111, 1, 0, 0, 0, 113, 112, 1, 0, 0, 0, 114, 17, 1, 0, 0, 0, 115, 116, 7, 2, 0, 0, 116, 19, 1, 0, 0, 0, 117, 118, 5, 19, 0, 0, 118, 21, 1, 0, 0, 0, 119, 120, 5, 16, 0, 0, 120, 23, 1, 0, 0, 0, 121, 122, 5, 17, 0, 0, 122, 25, 1, 0, 0, 0, 123, 124, 5, 13, 0, 0, 124, 125, 5, 20, 0, 0, 125, 27, 1, 0, 0, 0, 10, 46, 65, 67, 76, 80, 85, 94, 98, 107, 113 ]; IfcExpressionParser.vocabulary = new antlr.Vocabulary(IfcExpressionParser.literalNames, IfcExpressionParser.symbolicNames, []); IfcExpressionParser.decisionsToDFA = IfcExpressionParser._ATN.decisionToState.map((ds, index) => new antlr.DFA(ds, index)); class ExprContext extends antlr.ParserRuleContext { constructor(parent, invokingState) { super(parent, invokingState); } singleExpr() { return this.getRuleContext(0, SingleExprContext); } EOF() { return this.getToken(IfcExpressionParser.EOF, 0); } get ruleIndex() { return IfcExpressionParser.RULE_expr; } enterRule(listener) { if (listener.enterExpr) { listener.enterExpr(this); } } exitRule(listener) { if (listener.exitExpr) { listener.exitExpr(this); } } accept(visitor) { if (visitor.visitExpr) { return visitor.visitExpr(this); } else { return visitor.visitChildren(this); } } } exports.ExprContext = ExprContext; class SingleExprContext extends antlr.ParserRuleContext { constructor(parent, invokingState) { super(parent, invokingState); } get ruleIndex() { return IfcExpressionParser.RULE_singleExpr; } copyFrom(ctx) { super.copyFrom(ctx); } } exports.SingleExprContext = SingleExprContext; class SEUnaryMultipleMinusContext extends SingleExprContext { constructor(ctx) { super(ctx.parent, ctx.invokingState); super.copyFrom(ctx); } singleExpr() { return this.getRuleContext(0, SingleExprContext); } enterRule(listener) { if (listener.enterSEUnaryMultipleMinus) { listener.enterSEUnaryMultipleMinus(this); } } exitRule(listener) { if (listener.exitSEUnaryMultipleMinus) { listener.exitSEUnaryMultipleMinus(this); } } accept(visitor) { if (visitor.visitSEUnaryMultipleMinus) { return visitor.visitSEUnaryMultipleMinus(this); } else { return visitor.visitChildren(this); } } } exports.SEUnaryMultipleMinusContext = SEUnaryMultipleMinusContext; class SEParenthesisContext extends SingleExprContext { constructor(ctx) { super(ctx.parent, ctx.invokingState); super.copyFrom(ctx); } singleExpr() { return this.getRuleContext(0, SingleExprContext); } enterRule(listener) { if (listener.enterSEParenthesis) { listener.enterSEParenthesis(this); } } exitRule(listener) { if (listener.exitSEParenthesis) { listener.exitSEParenthesis(this); } } accept(visitor) { if (visitor.visitSEParenthesis) { return visitor.visitSEParenthesis(this); } else { return visitor.visitChildren(this); } } } exports.SEParenthesisContext = SEParenthesisContext; class SEUnaryMinusContext extends SingleExprContext { constructor(ctx) { super(ctx.parent, ctx.invokingState); super.copyFrom(ctx); } singleExpr() { return this.getRuleContext(0, SingleExprContext); } enterRule(listener) { if (listener.enterSEUnaryMinus) { listener.enterSEUnaryMinus(this); } } exitRule(listener) { if (listener.exitSEUnaryMinus) { listener.exitSEUnaryMinus(this); } } accept(visitor) { if (visitor.visitSEUnaryMinus) { return visitor.visitSEUnaryMinus(this); } else { return visitor.visitChildren(this); } } } exports.SEUnaryMinusContext = SEUnaryMinusContext; class SENotContext extends SingleExprContext { constructor(ctx) { super(ctx.parent, ctx.invokingState); super.copyFrom(ctx); } singleExpr() { return this.getRuleContext(0, SingleExprContext); } enterRule(listener) { if (listener.enterSENot) { listener.enterSENot(this); } } exitRule(listener) { if (listener.exitSENot) { listener.exitSENot(this); } } accept(visitor) { if (visitor.visitSENot) { return visitor.visitSENot(this); } else { return visitor.visitChildren(this); } } } exports.SENotContext = SENotContext; class SEVariableRefContext extends SingleExprContext { constructor(ctx) { super(ctx.parent, ctx.invokingState); super.copyFrom(ctx); } variableRef() { return this.getRuleContext(0, VariableRefContext); } enterRule(listener) { if (listener.enterSEVariableRef) { listener.enterSEVariableRef(this); } } exitRule(listener) { if (listener.exitSEVariableRef) { listener.exitSEVariableRef(this); } } accept(visitor) { if (visitor.visitSEVariableRef) { return visitor.visitSEVariableRef(this); } else { return visitor.visitChildren(this); } } } exports.SEVariableRefContext = SEVariableRefContext; class SEFunctionCallContext extends SingleExprContext { constructor(ctx) { super(ctx.parent, ctx.invokingState); super.copyFrom(ctx); } functionCall() { return this.getRuleContext(0, FunctionCallContext); } enterRule(listener) { if (listener.enterSEFunctionCall) { listener.enterSEFunctionCall(this); } } exitRule(listener) { if (listener.exitSEFunctionCall) { listener.exitSEFunctionCall(this); } } accept(visitor) { if (visitor.visitSEFunctionCall) { return visitor.visitSEFunctionCall(this); } else { return visitor.visitChildren(this); } } } exports.SEFunctionCallContext = SEFunctionCallContext; class SELiteralContext extends SingleExprContext { constructor(ctx) { super(ctx.parent, ctx.invokingState); super.copyFrom(ctx); } literal() { return this.getRuleContext(0, LiteralContext); } enterRule(listener) { if (listener.enterSELiteral) { listener.enterSELiteral(this); } } exitRule(listener) { if (listener.exitSELiteral) { listener.exitSELiteral(this); } } accept(visitor) { if (visitor.visitSELiteral) { return visitor.visitSELiteral(this); } else { return visitor.visitChildren(this); } } } exports.SELiteralContext = SELiteralContext; class SEArrayExprContext extends SingleExprContext { constructor(ctx) { super(ctx.parent, ctx.invokingState); super.copyFrom(ctx); } arrayExpr() { return this.getRuleContext(0, ArrayExprContext); } enterRule(listener) { if (listener.enterSEArrayExpr) { listener.enterSEArrayExpr(this); } } exitRule(listener) { if (listener.exitSEArrayExpr) { listener.exitSEArrayExpr(this); } } accept(visitor) { if (visitor.visitSEArrayExpr) { return visitor.visitSEArrayExpr(this); } else { return visitor.visitChildren(this); } } } exports.SEArrayExprContext = SEArrayExprContext; class SEPowerContext extends SingleExprContext { constructor(ctx) { super(ctx.parent, ctx.invokingState); super.copyFrom(ctx); } singleExpr(i) { if (i === undefined) { return this.getRuleContexts(SingleExprContext); } return this.getRuleContext(i, SingleExprContext); } enterRule(listener) { if (listener.enterSEPower) { listener.enterSEPower(this); } } exitRule(listener) { if (listener.exitSEPower) { listener.exitSEPower(this); } } accept(visitor) { if (visitor.visitSEPower) { return visitor.visitSEPower(this); } else { return visitor.visitChildren(this); } } } exports.SEPowerContext = SEPowerContext; class SEMulDivContext extends SingleExprContext { constructor(ctx) { super(ctx.parent, ctx.invokingState); super.copyFrom(ctx); } singleExpr(i) { if (i === undefined) { return this.getRuleContexts(SingleExprContext); } return this.getRuleContext(i, SingleExprContext); } enterRule(listener) { if (listener.enterSEMulDiv) { listener.enterSEMulDiv(this); } } exitRule(listener) { if (listener.exitSEMulDiv) { listener.exitSEMulDiv(this); } } accept(visitor) { if (visitor.visitSEMulDiv) { return visitor.visitSEMulDiv(this); } else { return visitor.visitChildren(this); } } } exports.SEMulDivContext = SEMulDivContext; class SEAddSubContext extends SingleExprContext { constructor(ctx) { super(ctx.parent, ctx.invokingState); super.copyFrom(ctx); } singleExpr(i) { if (i === undefined) { return this.getRuleContexts(SingleExprContext); } return this.getRuleContext(i, SingleExprContext); } enterRule(listener) { if (listener.enterSEAddSub) { listener.enterSEAddSub(this); } } exitRule(listener) { if (listener.exitSEAddSub) { listener.exitSEAddSub(this); } } accept(visitor) { if (visitor.visitSEAddSub) { return visitor.visitSEAddSub(this); } else { return visitor.visitChildren(this); } } } exports.SEAddSubContext = SEAddSubContext; class SEComparisonContext extends SingleExprContext { constructor(ctx) { super(ctx.parent, ctx.invokingState); super.copyFrom(ctx); } CMP_OP() { return this.getToken(IfcExpressionParser.CMP_OP, 0); } singleExpr(i) { if (i === undefined) { return this.getRuleContexts(SingleExprContext); } return this.getRuleContext(i, SingleExprContext); } enterRule(listener) { if (listener.enterSEComparison) { listener.enterSEComparison(this); } } exitRule(listener) { if (listener.exitSEComparison) { listener.exitSEComparison(this); } }