From 27b76b5a332e95e64f363f646bfde390a48d96e2 Mon Sep 17 00:00:00 2001 From: Mike Lischke Date: Thu, 26 May 2016 12:20:26 +0200 Subject: [PATCH] Fixed token toString() so it produces the output expected by the tests. --- runtime/Cpp/demo/Mac/antlr4-cpp-demo/main.cpp | 7 ++-- .../antlrcpp.xcodeproj/project.pbxproj | 4 +- runtime/Cpp/runtime/src/CommonToken.cpp | 40 ++++++++++++++----- runtime/Cpp/runtime/src/CommonToken.h | 20 +++++----- runtime/Cpp/runtime/src/Token.cpp | 19 --------- runtime/Cpp/runtime/src/Token.h | 38 ++++++++---------- runtime/Cpp/runtime/src/tree/Trees.cpp | 18 +++++---- .../runtime/src/tree/pattern/RuleTagToken.cpp | 26 ++++++------ .../runtime/src/tree/pattern/RuleTagToken.h | 24 +++++------ .../src/tree/pattern/TokenTagToken.cpp | 16 ++++---- .../runtime/src/tree/pattern/TokenTagToken.h | 8 ++-- .../v4/tool/templates/codegen/Cpp/Cpp.stg | 5 ++- 12 files changed, 115 insertions(+), 110 deletions(-) diff --git a/runtime/Cpp/demo/Mac/antlr4-cpp-demo/main.cpp b/runtime/Cpp/demo/Mac/antlr4-cpp-demo/main.cpp index 492c27c37..2db8e8d62 100644 --- a/runtime/Cpp/demo/Mac/antlr4-cpp-demo/main.cpp +++ b/runtime/Cpp/demo/Mac/antlr4-cpp-demo/main.cpp @@ -19,17 +19,16 @@ int main(int , const char **) { ANTLRInputStream input(u8"๐Ÿด = ๐Ÿ + \"๐Ÿ˜Ž\";(((x * ฯ€))) * ยต + โˆฐ; a + (x * (y ? 0 : 1) + z);"); TLexer lexer(&input); CommonTokenStream tokens(&lexer); -/* + tokens.fill(); for (auto token : tokens.getTokens()) { std::cout << token->toString() << std::endl; } - */ + TParser parser(&tokens); Ref tree = parser.main(); - std::cout << tree->toStringTree(&parser) << std::endl; - std::fstream("test.txt") << tree->toStringTree(&parser); + std::cout << tree->toStringTree(&parser) << std::endl << std::endl; return 0; } diff --git a/runtime/Cpp/runtime/antlrcpp.xcodeproj/project.pbxproj b/runtime/Cpp/runtime/antlrcpp.xcodeproj/project.pbxproj index ef71e88a4..09a172ddd 100644 --- a/runtime/Cpp/runtime/antlrcpp.xcodeproj/project.pbxproj +++ b/runtime/Cpp/runtime/antlrcpp.xcodeproj/project.pbxproj @@ -988,7 +988,7 @@ 276E5C9E1CDB57AA003FF4B4 /* BufferedTokenStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BufferedTokenStream.h; sourceTree = ""; }; 276E5C9F1CDB57AA003FF4B4 /* CharStream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CharStream.cpp; sourceTree = ""; }; 276E5CA01CDB57AA003FF4B4 /* CharStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CharStream.h; sourceTree = ""; }; - 276E5CA11CDB57AA003FF4B4 /* CommonToken.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CommonToken.cpp; sourceTree = ""; }; + 276E5CA11CDB57AA003FF4B4 /* CommonToken.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CommonToken.cpp; sourceTree = ""; wrapsLines = 0; }; 276E5CA21CDB57AA003FF4B4 /* CommonToken.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommonToken.h; sourceTree = ""; }; 276E5CA31CDB57AA003FF4B4 /* CommonTokenFactory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CommonTokenFactory.cpp; sourceTree = ""; }; 276E5CA41CDB57AA003FF4B4 /* CommonTokenFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommonTokenFactory.h; sourceTree = ""; }; @@ -1062,7 +1062,7 @@ 276E5CEC1CDB57AA003FF4B4 /* guid.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = guid.h; sourceTree = ""; }; 276E5CED1CDB57AA003FF4B4 /* StringUtils.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StringUtils.cpp; sourceTree = ""; }; 276E5CEE1CDB57AA003FF4B4 /* StringUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StringUtils.h; sourceTree = ""; }; - 276E5CEF1CDB57AA003FF4B4 /* Token.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Token.cpp; sourceTree = ""; }; + 276E5CEF1CDB57AA003FF4B4 /* Token.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Token.cpp; sourceTree = ""; wrapsLines = 0; }; 276E5CF01CDB57AA003FF4B4 /* Token.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Token.h; sourceTree = ""; }; 276E5CF21CDB57AA003FF4B4 /* TokenFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TokenFactory.h; sourceTree = ""; }; 276E5CF41CDB57AA003FF4B4 /* TokenSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TokenSource.h; sourceTree = ""; }; diff --git a/runtime/Cpp/runtime/src/CommonToken.cpp b/runtime/Cpp/runtime/src/CommonToken.cpp index a84012999..47ae374bf 100755 --- a/runtime/Cpp/runtime/src/CommonToken.cpp +++ b/runtime/Cpp/runtime/src/CommonToken.cpp @@ -95,7 +95,7 @@ void CommonToken::setLine(int line) { _line = line; } -std::string CommonToken::getText() { +std::string CommonToken::getText() const { if (!_text.empty()) { return _text; } @@ -116,11 +116,11 @@ void CommonToken::setText(const std::string &text) { _text = text; } -int CommonToken::getLine() { +int CommonToken::getLine() const { return _line; } -int CommonToken::getCharPositionInLine() { +int CommonToken::getCharPositionInLine() const { return _charPositionInLine; } @@ -128,7 +128,7 @@ void CommonToken::setCharPositionInLine(int charPositionInLine) { _charPositionInLine = charPositionInLine; } -size_t CommonToken::getChannel() { +size_t CommonToken::getChannel() const { return _channel; } @@ -140,7 +140,7 @@ void CommonToken::setType(int type) { _type = type; } -int CommonToken::getStartIndex() { +int CommonToken::getStartIndex() const { return _start; } @@ -148,7 +148,7 @@ void CommonToken::setStartIndex(int start) { _start = start; } -int CommonToken::getStopIndex() { +int CommonToken::getStopIndex() const { return _stop; } @@ -156,7 +156,7 @@ void CommonToken::setStopIndex(int stop) { _stop = stop; } -int CommonToken::getTokenIndex() { +int CommonToken::getTokenIndex() const { return _index; } @@ -164,14 +164,36 @@ void CommonToken::setTokenIndex(int index) { _index = index; } -org::antlr::v4::runtime::TokenSource *CommonToken::getTokenSource() { +org::antlr::v4::runtime::TokenSource *CommonToken::getTokenSource() const { return _source.first; } -org::antlr::v4::runtime::CharStream *CommonToken::getInputStream() { +org::antlr::v4::runtime::CharStream *CommonToken::getInputStream() const { return _source.second; } +std::string CommonToken::toString() const { + std::stringstream ss; + + std::string channelStr; + if (_channel > 0) { + channelStr = ",channel=" + std::to_string(_channel); + } + std::string txt = getText(); + if (!txt.empty()) { + antlrcpp::replaceAll(txt, "\n", "\\n"); + antlrcpp::replaceAll(txt, "\r", "\\r"); + antlrcpp::replaceAll(txt, "\t", "\\t"); + } else { + txt = ""; + } + + ss << "[@" << getTokenIndex() << "," << _start << ":" << _stop << "='" << txt << "',<" << _type << ">" << channelStr + << "," << _line << ":" << getCharPositionInLine() << "]"; + + return ss.str(); +} + void CommonToken::InitializeInstanceFields() { _type = 0; _line = 0; diff --git a/runtime/Cpp/runtime/src/CommonToken.h b/runtime/Cpp/runtime/src/CommonToken.h index dba234f42..33e4846f4 100755 --- a/runtime/Cpp/runtime/src/CommonToken.h +++ b/runtime/Cpp/runtime/src/CommonToken.h @@ -152,31 +152,33 @@ namespace runtime { * of the token. */ virtual void setText(const std::string &text) override; - virtual std::string getText() override; + virtual std::string getText() const override; virtual void setLine(int line) override; - virtual int getLine() override; + virtual int getLine() const override; - virtual int getCharPositionInLine() override; + virtual int getCharPositionInLine() const override; virtual void setCharPositionInLine(int charPositionInLine) override; - virtual size_t getChannel() override; + virtual size_t getChannel() const override; virtual void setChannel(int channel) override; virtual void setType(int type) override; - virtual int getStartIndex() override; + virtual int getStartIndex() const override; virtual void setStartIndex(int start); - virtual int getStopIndex() override; + virtual int getStopIndex() const override; virtual void setStopIndex(int stop); - virtual int getTokenIndex() override; + virtual int getTokenIndex() const override; virtual void setTokenIndex(int index) override; - virtual TokenSource *getTokenSource() override; - virtual CharStream *getInputStream() override; + virtual TokenSource *getTokenSource() const override; + virtual CharStream *getInputStream() const override; + virtual std::string toString() const override; + private: void InitializeInstanceFields(); }; diff --git a/runtime/Cpp/runtime/src/Token.cpp b/runtime/Cpp/runtime/src/Token.cpp index 3c2e8f419..a2bbdadbe 100755 --- a/runtime/Cpp/runtime/src/Token.cpp +++ b/runtime/Cpp/runtime/src/Token.cpp @@ -35,22 +35,3 @@ using namespace org::antlr::v4::runtime; -std::string Token::toString() { - std::stringstream ss; - - std::string txt = getText(); - if (!txt.empty()) { - - antlrcpp::replaceAll(txt, "\n", "\\n"); - antlrcpp::replaceAll(txt, "\r", "\\r"); - antlrcpp::replaceAll(txt, "\t", "\\t"); - } else { - txt = ""; - } - - ss << "{Token: " << txt << ", channel: " << getChannel() << ", type: " << getType() << ", start: " << getStartIndex() << - ", stop: " << getStopIndex() << ", index: " << getTokenIndex() << ", line: " << getLine() << ", offset: " << - getCharPositionInLine() << "}"; - - return ss.str(); -} diff --git a/runtime/Cpp/runtime/src/Token.h b/runtime/Cpp/runtime/src/Token.h index 37755ad2d..4723f67d7 100755 --- a/runtime/Cpp/runtime/src/Token.h +++ b/runtime/Cpp/runtime/src/Token.h @@ -38,34 +38,28 @@ namespace antlr { namespace v4 { namespace runtime { - /// /// A token has properties: text, type, line, character position in the line - /// (so we can ignore tabs), token channel, index, and source from which - /// we obtained this token. - /// + /// (so we can ignore tabs), token channel, index, and source from which + /// we obtained this token. class ANTLR4CPP_PUBLIC Token { public: static const size_t INVALID_TYPE = 0; /// During lookahead operations, this "token" signifies we hit rule end ATN state - /// and did not follow it despite needing to. + /// and did not follow it despite needing to. static const ssize_t EPSILON = -2; static const size_t MIN_USER_TOKEN_TYPE = 1; static const ssize_t EOF = IntStream::EOF; virtual ~Token() {}; - /// /// All tokens go to the parser (unless skip() is called in that rule) - /// on a particular "channel". The parser tunes to a particular channel - /// so that whitespace etc... can go to the parser on a "hidden" channel. - /// + /// on a particular "channel". The parser tunes to a particular channel + /// so that whitespace etc... can go to the parser on a "hidden" channel. static const size_t DEFAULT_CHANNEL = 0; - /// /// Anything on different channel than DEFAULT_CHANNEL is not parsed - /// by parser. - /// + /// by parser. static const size_t HIDDEN_CHANNEL = 1; /** @@ -84,7 +78,7 @@ namespace runtime { /// /// Get the text of the token. /// - virtual std::string getText() = 0; + virtual std::string getText() const = 0; /// /// Get the token type of the token @@ -94,20 +88,20 @@ namespace runtime { /// The line number on which the 1st character of this token was matched, /// line=1..n /// - virtual int getLine() = 0; + virtual int getLine() const = 0; /// /// The index of the first character of this token relative to the /// beginning of the line at which it occurs, 0..n-1 /// - virtual int getCharPositionInLine() = 0; + virtual int getCharPositionInLine() const = 0; /// /// Return the channel this token. Each token can arrive at the parser /// on a different channel, but the parser only "tunes" to a single channel. /// The parser ignores everything not on DEFAULT_CHANNEL. /// - virtual size_t getChannel() = 0; + virtual size_t getChannel() const = 0; /// /// An index from 0..n-1 of the token object in the input stream. @@ -117,31 +111,31 @@ namespace runtime { /// Return -1 to indicate that this token was conjured up since /// it doesn't have a valid index. /// - virtual int getTokenIndex() = 0; + virtual int getTokenIndex() const = 0; /// /// The starting character index of the token /// This method is optional; return -1 if not implemented. /// - virtual int getStartIndex() = 0; + virtual int getStartIndex() const = 0; /// /// The last character index of the token. /// This method is optional; return -1 if not implemented. /// - virtual int getStopIndex() = 0; + virtual int getStopIndex() const = 0; /// /// Gets the which created this token. /// - virtual TokenSource *getTokenSource() = 0; + virtual TokenSource *getTokenSource() const = 0; /// /// Gets the from which this token was derived. /// - virtual CharStream *getInputStream() = 0; + virtual CharStream *getInputStream() const = 0; - virtual std::string toString(); + virtual std::string toString() const = 0; }; } // namespace runtime diff --git a/runtime/Cpp/runtime/src/tree/Trees.cpp b/runtime/Cpp/runtime/src/tree/Trees.cpp index b0269b997..d5b899af4 100755 --- a/runtime/Cpp/runtime/src/tree/Trees.cpp +++ b/runtime/Cpp/runtime/src/tree/Trees.cpp @@ -90,18 +90,22 @@ std::string Trees::toStringTree(Ref t, const std::vector &rul std::string temp = antlrcpp::escapeWhitespace(Trees::getNodeText(child, ruleNames), false); if (child->getChildCount() > 0) { // Go deeper one level. - stack.push(childIndex + 1); + stack.push(childIndex); run = child; childIndex = 0; ss << "(" << temp << " "; } else { ss << temp; - if (++childIndex == run->getChildCount() && stack.size() > 0) { - // Reached the end of the current level. See if we can step up from here. - childIndex = stack.top(); - stack.pop(); - run = run->getParent().lock(); - ss << ")"; + while (++childIndex == run->getChildCount()) { + if (stack.size() > 0) { + // Reached the end of the current level. See if we can step up from here. + childIndex = stack.top(); + stack.pop(); + run = run->getParent().lock(); + ss << ")"; + } else { + break; + } } } } diff --git a/runtime/Cpp/runtime/src/tree/pattern/RuleTagToken.cpp b/runtime/Cpp/runtime/src/tree/pattern/RuleTagToken.cpp index 2449f97a6..ef344cd2d 100755 --- a/runtime/Cpp/runtime/src/tree/pattern/RuleTagToken.cpp +++ b/runtime/Cpp/runtime/src/tree/pattern/RuleTagToken.cpp @@ -46,19 +46,19 @@ RuleTagToken::RuleTagToken(const std::string &ruleName, int bypassTokenType, con } -std::string RuleTagToken::getRuleName() { +std::string RuleTagToken::getRuleName() const { return ruleName; } -std::string RuleTagToken::getLabel() { +std::string RuleTagToken::getLabel() const { return label; } -size_t RuleTagToken::getChannel() { +size_t RuleTagToken::getChannel() const { return DEFAULT_CHANNEL; } -std::string RuleTagToken::getText() { +std::string RuleTagToken::getText() const { if (label != "") { return std::string("<") + label + std::string(":") + ruleName + std::string(">"); } @@ -70,34 +70,34 @@ int RuleTagToken::getType() const { return bypassTokenType; } -int RuleTagToken::getLine() { +int RuleTagToken::getLine() const { return 0; } -int RuleTagToken::getCharPositionInLine() { +int RuleTagToken::getCharPositionInLine() const { return -1; } -int RuleTagToken::getTokenIndex() { +int RuleTagToken::getTokenIndex() const { return -1; } -int RuleTagToken::getStartIndex() { +int RuleTagToken::getStartIndex() const { return -1; } -int RuleTagToken::getStopIndex() { +int RuleTagToken::getStopIndex() const { return -1; } -org::antlr::v4::runtime::TokenSource *RuleTagToken::getTokenSource() { +org::antlr::v4::runtime::TokenSource *RuleTagToken::getTokenSource() const { return nullptr; } -org::antlr::v4::runtime::CharStream *RuleTagToken::getInputStream() { +org::antlr::v4::runtime::CharStream *RuleTagToken::getInputStream() const { return nullptr; } -std::string RuleTagToken::toString() { - return ruleName + std::string(":") + std::to_string(bypassTokenType); +std::string RuleTagToken::toString() const { + return ruleName + ":" + std::to_string(bypassTokenType); } diff --git a/runtime/Cpp/runtime/src/tree/pattern/RuleTagToken.h b/runtime/Cpp/runtime/src/tree/pattern/RuleTagToken.h index 4d17e5725..407d3ab77 100755 --- a/runtime/Cpp/runtime/src/tree/pattern/RuleTagToken.h +++ b/runtime/Cpp/runtime/src/tree/pattern/RuleTagToken.h @@ -91,21 +91,21 @@ namespace pattern { /// Gets the name of the rule associated with this rule tag. /// /// The name of the parser rule associated with this rule tag. - std::string getRuleName(); + std::string getRuleName() const; /// /// Gets the label associated with the rule tag. /// /// The name of the label associated with the rule tag, or /// {@code null} if this is an unlabeled rule tag. - std::string getLabel(); + std::string getLabel() const; /// /// {@inheritDoc} ///

/// Rule tag tokens are always placed on the . ///

- virtual size_t getChannel() override; + virtual size_t getChannel() const override; /// /// {@inheritDoc} @@ -113,7 +113,7 @@ namespace pattern { /// This method returns the rule tag formatted with {@code <} and {@code >} /// delimiters. /// - virtual std::string getText() override; + virtual std::string getText() const override; /// /// {@inheritDoc} @@ -128,49 +128,49 @@ namespace pattern { ///

/// The implementation for always returns 0. ///

- virtual int getLine() override; + virtual int getLine() const override; /// /// {@inheritDoc} ///

/// The implementation for always returns -1. ///

- virtual int getCharPositionInLine() override; + virtual int getCharPositionInLine() const override; /// /// {@inheritDoc} ///

/// The implementation for always returns -1. ///

- virtual int getTokenIndex() override; + virtual int getTokenIndex() const override; /// /// {@inheritDoc} ///

/// The implementation for always returns -1. ///

- virtual int getStartIndex() override; + virtual int getStartIndex() const override; /// /// {@inheritDoc} ///

/// The implementation for always returns -1. ///

- virtual int getStopIndex() override; + virtual int getStopIndex() const override; /// /// {@inheritDoc} ///

/// The implementation for always returns {@code null}. ///

- virtual TokenSource *getTokenSource() override; + virtual TokenSource *getTokenSource() const override; /// /// {@inheritDoc} ///

/// The implementation for always returns {@code null}. ///

- virtual CharStream *getInputStream() override; + virtual CharStream *getInputStream() const override; /// /// {@inheritDoc} @@ -178,7 +178,7 @@ namespace pattern { /// The implementation for returns a string of the form /// {@code ruleName:bypassTokenType}. /// - virtual std::string toString() override; + virtual std::string toString() const override; }; } // namespace pattern diff --git a/runtime/Cpp/runtime/src/tree/pattern/TokenTagToken.cpp b/runtime/Cpp/runtime/src/tree/pattern/TokenTagToken.cpp index 630b0f488..34ec61225 100755 --- a/runtime/Cpp/runtime/src/tree/pattern/TokenTagToken.cpp +++ b/runtime/Cpp/runtime/src/tree/pattern/TokenTagToken.cpp @@ -41,22 +41,22 @@ TokenTagToken::TokenTagToken(const std::string &tokenName, int type, const std:: : CommonToken(type), tokenName(tokenName), label(label) { } -std::string TokenTagToken::getTokenName() { +std::string TokenTagToken::getTokenName() const { return tokenName; } -std::string TokenTagToken::getLabel() { +std::string TokenTagToken::getLabel() const { return label; } -std::string TokenTagToken::getText() { - if (label != "") { - return std::string("<") + label + std::string(":") + tokenName + std::string(">"); +std::string TokenTagToken::getText() const { + if (!label.empty()) { + return "<" + label + ":" + tokenName + ">"; } - return std::string("<") + tokenName + std::string(">"); + return "<" + tokenName + ">"; } -std::string TokenTagToken::toString() { - return tokenName + std::string(":") + std::to_string(_type); +std::string TokenTagToken::toString() const { + return tokenName + ":" + std::to_string(_type); } diff --git a/runtime/Cpp/runtime/src/tree/pattern/TokenTagToken.h b/runtime/Cpp/runtime/src/tree/pattern/TokenTagToken.h index 9aa1cd462..85fa5e5d6 100755 --- a/runtime/Cpp/runtime/src/tree/pattern/TokenTagToken.h +++ b/runtime/Cpp/runtime/src/tree/pattern/TokenTagToken.h @@ -78,14 +78,14 @@ namespace pattern { /// /// Gets the token name. /// The token name. - std::string getTokenName(); + std::string getTokenName() const; /// /// Gets the label associated with the rule tag. /// /// The name of the label associated with the rule tag, or /// {@code null} if this is an unlabeled rule tag. - std::string getLabel(); + std::string getLabel() const; /// /// {@inheritDoc} @@ -93,7 +93,7 @@ namespace pattern { /// The implementation for returns the token tag /// formatted with {@code <} and {@code >} delimiters. /// - virtual std::string getText() override; + virtual std::string getText() const override; /// /// {@inheritDoc} @@ -101,7 +101,7 @@ namespace pattern { /// The implementation for returns a string of the form /// {@code tokenName:type}. /// - virtual std::string toString() override; + virtual std::string toString() const override; }; } // namespace pattern diff --git a/tool/resources/org/antlr/v4/tool/templates/codegen/Cpp/Cpp.stg b/tool/resources/org/antlr/v4/tool/templates/codegen/Cpp/Cpp.stg index 5eed14ad2..1afd0e096 100644 --- a/tool/resources/org/antlr/v4/tool/templates/codegen/Cpp/Cpp.stg +++ b/tool/resources/org/antlr/v4/tool/templates/codegen/Cpp/Cpp.stg @@ -908,7 +908,10 @@ RulePropertyRef_ctx(r) ::= "RulePropertyRef_ctx(r)." ThisRulePropertyRef_start(r) ::= "ThisRulePropertyRef_start(r) _localctx->start" ThisRulePropertyRef_stop(r) ::= "ThisRulePropertyRef_stop(r) _localctx->stop" -ThisRulePropertyRef_text(r) ::= "ThisRulePropertyRef_text(r) input->getText(_localctx->start, _input->LT(-1))" + +ThisRulePropertyRef_textHeader(r) ::= "" +ThisRulePropertyRef_text(r) ::= "input->getText(_localctx->start, _input->LT(-1))" + ThisRulePropertyRef_ctx(r) ::= "ThisRulePropertyRef_ctx(r) _localctx" NonLocalAttrRef(s) ::= "NonLocalAttrRef(s) ((Context)getInvokingContext())."