From: <ibr...@us...> - 2013-04-17 15:18:32
|
Revision: 4627 http://sourceforge.net/p/tora/code/4627 Author: ibre5041 Date: 2013-04-17 15:18:27 +0000 (Wed, 17 Apr 2013) Log Message: ----------- const corectness Modified Paths: -------------- branches/tora3/extlibs/libantlr3cpp-3.5.1/include/antlr3baserecognizer.inl branches/tora3/extlibs/libantlr3cpp-3.5.1/include/antlr3commontoken.hpp branches/tora3/extlibs/libantlr3cpp-3.5.1/include/antlr3commontoken.inl branches/tora3/extlibs/libantlr3cpp-3.5.1/include/antlr3commontree.hpp branches/tora3/extlibs/libantlr3cpp-3.5.1/include/antlr3commontree.inl branches/tora3/extlibs/libantlr3cpp-3.5.1/include/antlr3commontreeadaptor.hpp branches/tora3/extlibs/libantlr3cpp-3.5.1/include/antlr3commontreeadaptor.inl branches/tora3/extlibs/libantlr3cpp-3.5.1/include/antlr3cyclicdfa.inl branches/tora3/extlibs/libantlr3cpp-3.5.1/include/antlr3exception.hpp branches/tora3/extlibs/libantlr3cpp-3.5.1/include/antlr3exception.inl branches/tora3/extlibs/libantlr3cpp-3.5.1/include/antlr3intstream.inl branches/tora3/extlibs/libantlr3cpp-3.5.1/include/antlr3lexer.inl branches/tora3/extlibs/libantlr3cpp-3.5.1/include/antlr3parser.inl branches/tora3/extlibs/libantlr3cpp-3.5.1/include/antlr3tokenstream.inl branches/tora3/extlibs/parsing.cpp/Makefile branches/tora3/extlibs/parsing.cpp/antlr-complete-3.5.1-SNAPSHOT.jar branches/tora3/extlibs/parsing.cpp/org/antlr/codegen/templates/Cpp/AST.stg branches/tora3/extlibs/parsing.cpp/org/antlr/codegen/templates/Cpp/ASTParser.stg branches/tora3/extlibs/parsing.cpp/org/antlr/codegen/templates/Cpp/Cpp.stg Modified: branches/tora3/extlibs/libantlr3cpp-3.5.1/include/antlr3baserecognizer.inl =================================================================== --- branches/tora3/extlibs/libantlr3cpp-3.5.1/include/antlr3baserecognizer.inl 2013-04-17 08:31:56 UTC (rev 4626) +++ branches/tora3/extlibs/libantlr3cpp-3.5.1/include/antlr3baserecognizer.inl 2013-04-17 15:18:27 UTC (rev 4627) @@ -112,7 +112,7 @@ if (nextt == ttype) { if(m_state->get_exception() != NULL) - m_state->get_exception()->set_expecting(nextt); + m_state->get_exception()->setExpecting(nextt); return true; // This token is unknown, but the next one is the one we wanted } else @@ -480,8 +480,8 @@ // new ANTLR_Exception<ImplTraits, MISSING_TOKEN_EXCEPTION, StreamType>(this, ""); matchedSymbol = this->getMissingSymbol( is, m_state->get_exception(), ttype, follow); - m_state->get_exception()->set_token( matchedSymbol ); - m_state->get_exception()->set_expecting(ttype); + m_state->get_exception()->setToken( matchedSymbol ); + m_state->get_exception()->setExpecting(ttype); // Print out the error after we insert so that ANTLRWorks sees the // token in the exception. Modified: branches/tora3/extlibs/libantlr3cpp-3.5.1/include/antlr3commontoken.hpp =================================================================== --- branches/tora3/extlibs/libantlr3cpp-3.5.1/include/antlr3commontoken.hpp 2013-04-17 08:31:56 UTC (rev 4626) +++ branches/tora3/extlibs/libantlr3cpp-3.5.1/include/antlr3commontoken.hpp 2013-04-17 15:18:27 UTC (rev 4627) @@ -138,10 +138,10 @@ bool operator==( const CommonToken& ctoken ) const; bool operator<( const CommonToken& ctoken ) const; - InputStreamType* get_input() const; - ANTLR_MARKER get_index() const; - void set_index( ANTLR_MARKER index ); - void set_input( InputStreamType* input ); + InputStreamType* getInput() const; + ANTLR_MARKER getIndex() const; + void setIndex( ANTLR_MARKER index ); + void setInput( InputStreamType* input ); /* ============================== * API @@ -152,16 +152,16 @@ */ StringType getText() const; - /** Pointer to a function that 'might' be able to set the text associated + /** Function that 'might' be able to set the text associated * with a token. Imaginary tokens such as an ANTLR3_CLASSIC_TOKEN may actually * do this, however many tokens such as ANTLR3_COMMON_TOKEN do not actaully have * strings associated with them but just point into the current input stream. These * tokens will implement this function with a function that errors out (probably * drastically. */ - void set_tokText( const StringType& text ); + void setTokText( const StringType& text ); - /** Pointer to a function that 'might' be able to set the text associated + /** Function that 'might' be able to set the text associated * with a token. Imaginary tokens such as an ANTLR3_CLASSIC_TOKEN may actually * do this, however many tokens such as ANTLR3_COMMON_TOKEN do not actully have * strings associated with them but just point into the current input stream. These @@ -171,70 +171,68 @@ void setText(ANTLR_UINT8* text); void setText(const char* text); - /** Pointer to a function that returns the token type of this token + /** Function that returns the token type of this token */ - ANTLR_UINT32 get_type() const; ANTLR_UINT32 getType() const; - /** Pointer to a function that sets the type of this token + /** Function that sets the type of this token */ - void set_type(ANTLR_UINT32 ttype); + void setType(ANTLR_UINT32 ttype); - /** Pointer to a function that gets the 'line' number where this token resides + /** Function that gets the 'line' number where this token resides */ - ANTLR_UINT32 get_line() const; + ANTLR_UINT32 getLine() const; - /** Pointer to a function that sets the 'line' number where this token reside + /** Function that sets the 'line' number where this token reside */ - void set_line(ANTLR_UINT32 line); + void setLine(ANTLR_UINT32 line); - /** Pointer to a function that gets the offset in the line where this token exists + /** Function that gets the offset in the line where this token exists */ - ANTLR_INT32 get_charPositionInLine() const; - ANTLR_INT32 getCharPositionInLine() const; + ANTLR_INT32 getCharPositionInLine() const; - /** Pointer to a function that sets the offset in the line where this token exists + /** Function that sets the offset in the line where this token exists */ - void set_charPositionInLine(ANTLR_INT32 pos); + void setCharPositionInLine(ANTLR_INT32 pos); - /** Pointer to a function that gets the channel that this token was placed in (parsers + /** Function that gets the channel that this token was placed in (parsers * can 'tune' to these channels. */ - ANTLR_UINT32 get_channel() const; + ANTLR_UINT32 getChannel() const; - /** Pointer to a function that sets the channel that this token should belong to + /** Function that sets the channel that this token should belong to */ - void set_channel(ANTLR_UINT32 channel); + void setChannel(ANTLR_UINT32 channel); - /** Pointer to a function that returns an index 0...n-1 of the token in the token + /** Function that returns an index 0...n-1 of the token in the token * input stream. */ - ANTLR_MARKER get_tokenIndex() const; + ANTLR_MARKER getTokenIndex() const; - /** Pointer to a function that can set the token index of this token in the token + /** Function that can set the token index of this token in the token * input stream. */ - void set_tokenIndex(ANTLR_MARKER tokenIndex); + void setTokenIndex(ANTLR_MARKER tokenIndex); - /** Pointer to a function that gets the start index in the input stream for this token. + /** Function that gets the start index in the input stream for this token. */ - ANTLR_MARKER get_startIndex() const; + ANTLR_MARKER getStartIndex() const; - /** Pointer to a function that sets the start index in the input stream for this token. + /** Function that sets the start index in the input stream for this token. */ - void set_startIndex(ANTLR_MARKER index); + void setStartIndex(ANTLR_MARKER index); - /** Pointer to a function that gets the stop index in the input stream for this token. + /** Function that gets the stop index in the input stream for this token. */ - ANTLR_MARKER get_stopIndex() const; + ANTLR_MARKER getStopIndex() const; - /** Pointer to a function that sets the stop index in the input stream for this token. + /** Function that sets the stop index in the input stream for this token. */ - void set_stopIndex(ANTLR_MARKER index); - const StreamDataType* get_lineStart() const; - void set_lineStart( const StreamDataType* lineStart ); + void setStopIndex(ANTLR_MARKER index); + const StreamDataType* getLineStart() const; + void setLineStart( const StreamDataType* lineStart ); - /** Pointer to a function that returns this token as a text representation that can be + /** Function that returns this token as a text representation that can be * printed with embedded control codes such as \n replaced with the printable sequence "\\n" * This also yields a string structure that can be used more easily than the pointer to * the input stream in certain situations. Modified: branches/tora3/extlibs/libantlr3cpp-3.5.1/include/antlr3commontoken.inl =================================================================== --- branches/tora3/extlibs/libantlr3cpp-3.5.1/include/antlr3commontoken.inl 2013-04-17 08:31:56 UTC (rev 4626) +++ branches/tora3/extlibs/libantlr3cpp-3.5.1/include/antlr3commontoken.inl 2013-04-17 15:18:27 UTC (rev 4627) @@ -95,25 +95,25 @@ } template<class ImplTraits> -ANTLR_INLINE typename CommonToken<ImplTraits>::InputStreamType* CommonToken<ImplTraits>::get_input() const +ANTLR_INLINE typename CommonToken<ImplTraits>::InputStreamType* CommonToken<ImplTraits>::getInput() const { return m_input; } template<class ImplTraits> -ANTLR_INLINE ANTLR_MARKER CommonToken<ImplTraits>::get_index() const +ANTLR_INLINE ANTLR_MARKER CommonToken<ImplTraits>::getIndex() const { return m_index; } template<class ImplTraits> -ANTLR_INLINE void CommonToken<ImplTraits>::set_index( ANTLR_MARKER index ) +ANTLR_INLINE void CommonToken<ImplTraits>::setIndex( ANTLR_MARKER index ) { m_index = index; } template<class ImplTraits> -void CommonToken<ImplTraits>::set_input( InputStreamType* input ) +void CommonToken<ImplTraits>::setInput( InputStreamType* input ) { m_input = input; } @@ -136,7 +136,7 @@ // from the input stream // if (m_input != NULL) - return m_input->substr( this->get_startIndex(), this->get_stopIndex() ); + return m_input->substr( this->getStartIndex(), this->getStopIndex() ); // Nothing to return, there is no input stream // @@ -144,7 +144,7 @@ } template<class ImplTraits> -ANTLR_INLINE void CommonToken<ImplTraits>::set_tokText( const StringType& text ) +ANTLR_INLINE void CommonToken<ImplTraits>::setTokText( const StringType& text ) { m_tokText = text; } @@ -168,109 +168,97 @@ } template<class ImplTraits> -ANTLR_INLINE ANTLR_UINT32 CommonToken<ImplTraits>::get_type() const -{ - return m_type; -} - -template<class ImplTraits> ANTLR_INLINE ANTLR_UINT32 CommonToken<ImplTraits>::getType() const { return m_type; } template<class ImplTraits> -ANTLR_INLINE void CommonToken<ImplTraits>::set_type(ANTLR_UINT32 ttype) +ANTLR_INLINE void CommonToken<ImplTraits>::setType(ANTLR_UINT32 ttype) { m_type = ttype; } template<class ImplTraits> -ANTLR_INLINE ANTLR_UINT32 CommonToken<ImplTraits>::get_line() const +ANTLR_INLINE ANTLR_UINT32 CommonToken<ImplTraits>::getLine() const { return m_line; } template<class ImplTraits> -ANTLR_INLINE void CommonToken<ImplTraits>::set_line(ANTLR_UINT32 line) +ANTLR_INLINE void CommonToken<ImplTraits>::setLine(ANTLR_UINT32 line) { m_line = line; } template<class ImplTraits> -ANTLR_INLINE ANTLR_INT32 CommonToken<ImplTraits>::get_charPositionInLine() const +ANTLR_INLINE ANTLR_INT32 CommonToken<ImplTraits>::getCharPositionInLine() const { return m_charPositionInLine; } template<class ImplTraits> -ANTLR_INLINE ANTLR_INT32 CommonToken<ImplTraits>::getCharPositionInLine() const +ANTLR_INLINE void CommonToken<ImplTraits>::setCharPositionInLine(ANTLR_INT32 pos) { - return this->get_charPositionInLine(); -} - -template<class ImplTraits> -ANTLR_INLINE void CommonToken<ImplTraits>::set_charPositionInLine(ANTLR_INT32 pos) -{ m_charPositionInLine = pos; } template<class ImplTraits> -ANTLR_INLINE ANTLR_UINT32 CommonToken<ImplTraits>::get_channel() const +ANTLR_INLINE ANTLR_UINT32 CommonToken<ImplTraits>::getChannel() const { return m_channel; } template<class ImplTraits> -ANTLR_INLINE void CommonToken<ImplTraits>::set_channel(ANTLR_UINT32 channel) +ANTLR_INLINE void CommonToken<ImplTraits>::setChannel(ANTLR_UINT32 channel) { m_channel = channel; } template<class ImplTraits> -ANTLR_INLINE ANTLR_MARKER CommonToken<ImplTraits>::get_tokenIndex() const +ANTLR_INLINE ANTLR_MARKER CommonToken<ImplTraits>::getTokenIndex() const { return m_index; } template<class ImplTraits> -ANTLR_INLINE void CommonToken<ImplTraits>::set_tokenIndex(ANTLR_MARKER tokenIndex) +ANTLR_INLINE void CommonToken<ImplTraits>::setTokenIndex(ANTLR_MARKER tokenIndex) { m_index = tokenIndex; } template<class ImplTraits> -ANTLR_INLINE ANTLR_MARKER CommonToken<ImplTraits>::get_startIndex() const +ANTLR_INLINE ANTLR_MARKER CommonToken<ImplTraits>::getStartIndex() const { return (m_startIndex == -1) ? (ANTLR_MARKER)(m_input->get_data()) : m_startIndex; } template<class ImplTraits> -ANTLR_INLINE void CommonToken<ImplTraits>::set_startIndex(ANTLR_MARKER index) +ANTLR_INLINE void CommonToken<ImplTraits>::setStartIndex(ANTLR_MARKER index) { m_startIndex = index; } template<class ImplTraits> -ANTLR_INLINE ANTLR_MARKER CommonToken<ImplTraits>::get_stopIndex() const +ANTLR_INLINE ANTLR_MARKER CommonToken<ImplTraits>::getStopIndex() const { return m_stopIndex; } template<class ImplTraits> -ANTLR_INLINE void CommonToken<ImplTraits>::set_stopIndex(ANTLR_MARKER index) +ANTLR_INLINE void CommonToken<ImplTraits>::setStopIndex(ANTLR_MARKER index) { m_stopIndex = index; } template<class ImplTraits> -ANTLR_INLINE const typename CommonToken<ImplTraits>::StreamDataType* CommonToken<ImplTraits>::get_lineStart() const +ANTLR_INLINE const typename CommonToken<ImplTraits>::StreamDataType* CommonToken<ImplTraits>::getLineStart() const { return m_lineStart; } template<class ImplTraits> -ANTLR_INLINE void CommonToken<ImplTraits>::set_lineStart( const StreamDataType* lineStart ) +ANTLR_INLINE void CommonToken<ImplTraits>::setLineStart( const StreamDataType* lineStart ) { m_lineStart = lineStart; } @@ -292,28 +280,28 @@ * return "[@"+getTokenIndex()+","+start+":"+stop+"='"+txt+"',<"+type+">"+channelStr+","+line+":"+getCharPositionInLine()+"]"; */ outtext << "[Index: "; - outtext << (int)this->get_tokenIndex(); + outtext << (int)this->getTokenIndex(); outtext << " (Start: "; - outtext << (int)this->get_startIndex(); + outtext << (int)this->getStartIndex(); outtext << "-Stop: "; - outtext << (int)this->get_stopIndex(); + outtext << (int)this->getStopIndex(); outtext << ") ='"; outtext << text; outtext << "', type<"; outtext << (int)m_type; outtext << "> "; - if (this->get_channel() > TOKEN_DEFAULT_CHANNEL) + if (this->getChannel() > TOKEN_DEFAULT_CHANNEL) { outtext << "(channel = "; - outtext << (int)this->get_channel(); + outtext << (int)this->getChannel(); outtext << ") "; } outtext << "Line: "; - outtext << (int)this->get_line(); + outtext << (int)this->getLine(); outtext << " LinePos:"; - outtext << (int)this->get_charPositionInLine(); + outtext << (int)this->getCharPositionInLine(); outtext << "]"; return outtext.str(); Modified: branches/tora3/extlibs/libantlr3cpp-3.5.1/include/antlr3commontree.hpp =================================================================== --- branches/tora3/extlibs/libantlr3cpp-3.5.1/include/antlr3commontree.hpp 2013-04-17 08:31:56 UTC (rev 4626) +++ branches/tora3/extlibs/libantlr3cpp-3.5.1/include/antlr3commontree.hpp 2013-04-17 15:18:27 UTC (rev 4627) @@ -70,7 +70,7 @@ /// A single token, this is the payload for the tree /// - CommonTokenType* m_token; + const CommonTokenType* m_token; /// Points to the node that has this node as a child. /// If this is NULL, then this is the root node. @@ -84,7 +84,7 @@ public: CommonTree(); - CommonTree( CommonTokenType* token ); + CommonTree( const CommonTokenType* token ); CommonTree( CommonTree* token ); CommonTree( const CommonTree& ctree ); @@ -92,12 +92,19 @@ ChildrenType& get_children(); const ChildrenType& get_children() const; ChildrenType* get_children_p(); - ANTLR_INT32 get_childIndex() const; - TreeType* get_parent() const; + ANTLR_INT32 getChildIndex() const; + TreeType* getParent() const; - void set_parent( TreeType* parent); - void set_childIndex( ANTLR_INT32 ); + ANTLR_MARKER getStartIndex() const; + void setStartIndex(ANTLR_MARKER index); + ANTLR_MARKER getStopIndex() const; + void setStopIndex(ANTLR_MARKER index); + + + void setParent( TreeType* parent); + void setChildIndex( ANTLR_INT32 ); + void addChild(TreeType* child); /// Add all elements of the supplied list as children of this node /// Modified: branches/tora3/extlibs/libantlr3cpp-3.5.1/include/antlr3commontree.inl =================================================================== --- branches/tora3/extlibs/libantlr3cpp-3.5.1/include/antlr3commontree.inl 2013-04-17 08:31:56 UTC (rev 4626) +++ branches/tora3/extlibs/libantlr3cpp-3.5.1/include/antlr3commontree.inl 2013-04-17 15:18:27 UTC (rev 4627) @@ -24,7 +24,7 @@ } template<class ImplTraits> -CommonTree<ImplTraits>::CommonTree( CommonTokenType* token ) +CommonTree<ImplTraits>::CommonTree( const CommonTokenType* token ) { m_savedIndex = 0; m_startIndex = 0; @@ -352,13 +352,13 @@ } template<class ImplTraits> -void CommonTree<ImplTraits>::set_childIndex( ANTLR_INT32 i) +void CommonTree<ImplTraits>::setChildIndex( ANTLR_INT32 i) { m_childIndex = i; } template<class ImplTraits> -ANTLR_INT32 CommonTree<ImplTraits>::get_childIndex() const +ANTLR_INT32 CommonTree<ImplTraits>::getChildIndex() const { return m_childIndex; } @@ -370,18 +370,42 @@ } template<class ImplTraits> -typename CommonTree<ImplTraits>::TreeType* CommonTree<ImplTraits>::get_parent() const +typename CommonTree<ImplTraits>::TreeType* CommonTree<ImplTraits>::getParent() const { return m_parent; } template<class ImplTraits> -void CommonTree<ImplTraits>::set_parent( TreeType* parent) +void CommonTree<ImplTraits>::setParent( TreeType* parent) { m_parent = parent; } template<class ImplTraits> +ANTLR_MARKER CommonTree<ImplTraits>::getStartIndex() const +{ + return m_startIndex; +} + +template<class ImplTraits> +void CommonTree<ImplTraits>::setStartIndex( ANTLR_MARKER index) +{ + m_startIndex = index; +} + +template<class ImplTraits> +ANTLR_MARKER CommonTree<ImplTraits>::getStopIndex() const +{ + return m_stopIndex; +} + +template<class ImplTraits> +void CommonTree<ImplTraits>::setStopIndex( ANTLR_MARKER index) +{ + m_stopIndex = index; +} + +template<class ImplTraits> ANTLR_UINT32 CommonTree<ImplTraits>::getType() { if (this == NULL) Modified: branches/tora3/extlibs/libantlr3cpp-3.5.1/include/antlr3commontreeadaptor.hpp =================================================================== --- branches/tora3/extlibs/libantlr3cpp-3.5.1/include/antlr3commontreeadaptor.hpp 2013-04-17 08:31:56 UTC (rev 4626) +++ branches/tora3/extlibs/libantlr3cpp-3.5.1/include/antlr3commontreeadaptor.hpp 2013-04-17 15:18:27 UTC (rev 4627) @@ -45,7 +45,7 @@ typedef typename ImplTraits::TreeType TreeType; typedef TreeType TokenType; typedef typename ImplTraits::CommonTokenType CommonTokenType; - typedef typename ImplTraits::DebugEventListener DebuggerType; + typedef typename ImplTraits::DebugEventListenerType DebuggerType; public: //The parameter is there only to provide uniform constructor interface @@ -59,7 +59,7 @@ void setParent( TreeType* child, TreeType* parent); TreeType* getParent( TreeType* child); - TreeType* errorNode( CommonTokenType* tnstream, CommonTokenType* startToken, CommonTokenType* stopToken); + TreeType* errorNode( CommonTokenType* tnstream, const CommonTokenType* startToken, const CommonTokenType* stopToken); bool isNilNode( TreeType* t); TreeType* becomeRoot( TreeType* newRoot, TreeType* oldRoot); @@ -67,7 +67,7 @@ TreeType* becomeRootToken(CommonTokenType* newRoot, TreeType* oldRoot); - TreeType* create( CommonTokenType* payload); + TreeType* create(const CommonTokenType* payload); TreeType* createTypeToken( ANTLR_UINT32 tokenType, CommonTokenType* fromToken); TreeType* createTypeTokenText ( ANTLR_UINT32 tokenType, CommonTokenType* fromToken, const ANTLR_UINT8* text); TreeType* createTypeText ( ANTLR_UINT32 tokenType, const ANTLR_UINT8* text); @@ -89,7 +89,7 @@ CommonTokenType* createTokenFromToken( CommonTokenType* fromToken); CommonTokenType* getToken( TreeType* t); - void setTokenBoundaries( TreeType* t, CommonTokenType* startToken, CommonTokenType* stopToken); + void setTokenBoundaries( TreeType* t, const CommonTokenType* startToken, const CommonTokenType* stopToken); ANTLR_MARKER getTokenStartIndex( TreeType* t); ANTLR_MARKER getTokenStopIndex( TreeType* t); Modified: branches/tora3/extlibs/libantlr3cpp-3.5.1/include/antlr3commontreeadaptor.inl =================================================================== --- branches/tora3/extlibs/libantlr3cpp-3.5.1/include/antlr3commontreeadaptor.inl 2013-04-17 08:31:56 UTC (rev 4626) +++ branches/tora3/extlibs/libantlr3cpp-3.5.1/include/antlr3commontreeadaptor.inl 2013-04-17 15:18:27 UTC (rev 4627) @@ -71,20 +71,24 @@ } template<class ImplTraits> -typename CommonTreeAdaptor<ImplTraits>::TreeType* CommonTreeAdaptor<ImplTraits>::getParent( TreeType* child) +typename CommonTreeAdaptor<ImplTraits>::TreeType* +CommonTreeAdaptor<ImplTraits>::getParent( TreeType* child) { return child->getParent(); } template<class ImplTraits> -typename CommonTreeAdaptor<ImplTraits>::TreeType* CommonTreeAdaptor<ImplTraits>::errorNode( CommonTokenType* tnstream, CommonTokenType* startToken, CommonTokenType* stopToken) +typename CommonTreeAdaptor<ImplTraits>::TreeType* +CommonTreeAdaptor<ImplTraits>::errorNode( CommonTokenType* tnstream, + const CommonTokenType* startToken, + const CommonTokenType* stopToken) { // Use the supplied common tree node stream to get another tree from the factory // TODO: Look at creating the erronode as in Java, but this is complicated by the // need to track and free the memory allocated to it, so for now, we just // want something in the tree that isn't a NULL pointer. // - return this->createTypeText( CommonTokenType::TOKEN_INVALID, "Tree Error Node"); + return this->createTypeText( CommonTokenType::TOKEN_INVALID, (const ANTLR_UINT8*)"Tree Error Node"); } @@ -95,7 +99,8 @@ } template<class ImplTraits> -typename CommonTreeAdaptor<ImplTraits>::TreeType* CommonTreeAdaptor<ImplTraits>::becomeRoot( TreeType* newRootTree, TreeType* oldRootTree) +typename CommonTreeAdaptor<ImplTraits>::TreeType* +CommonTreeAdaptor<ImplTraits>::becomeRoot( TreeType* newRootTree, TreeType* oldRootTree) { TreeType* saveRoot; @@ -172,7 +177,7 @@ } template<class ImplTraits> -typename CommonTreeAdaptor<ImplTraits>::TreeType* CommonTreeAdaptor<ImplTraits>::create( CommonTokenType* payload) +typename CommonTreeAdaptor<ImplTraits>::TreeType* CommonTreeAdaptor<ImplTraits>::create(const CommonTokenType* payload) { return new TreeType(payload); } @@ -297,7 +302,7 @@ if (newToken != NULL) { - newToken->set_tokText( (const char*) text ); + newToken->setTokText( (const char*) text ); newToken->setType(tokenType); } return newToken; @@ -337,7 +342,7 @@ } template<class ImplTraits> -void CommonTreeAdaptor<ImplTraits>::setTokenBoundaries( TreeType* t, CommonTokenType* startToken, CommonTokenType* stopToken) +void CommonTreeAdaptor<ImplTraits>::setTokenBoundaries( TreeType* t, const CommonTokenType* startToken, const CommonTokenType* stopToken) { ANTLR_MARKER start; ANTLR_MARKER stop; @@ -369,8 +374,8 @@ ct = t; - ct->set_startIndex(start); - ct->set_stopIndex(stop); + ct->setStartIndex(start); + ct->setStopIndex(stop); } template<class ImplTraits> Modified: branches/tora3/extlibs/libantlr3cpp-3.5.1/include/antlr3cyclicdfa.inl =================================================================== --- branches/tora3/extlibs/libantlr3cpp-3.5.1/include/antlr3cyclicdfa.inl 2013-04-17 08:31:56 UTC (rev 4626) +++ branches/tora3/extlibs/libantlr3cpp-3.5.1/include/antlr3cyclicdfa.inl 2013-04-17 15:18:27 UTC (rev 4627) @@ -196,8 +196,8 @@ { ANTLR_Exception<ImplTraits, NO_VIABLE_ALT_EXCEPTION, StreamType>* ex = new ANTLR_Exception<ImplTraits, NO_VIABLE_ALT_EXCEPTION, StreamType>( rec, (const char*)m_description ); - ex->set_decisionNum( m_decisionNumber ); - ex->set_state(s); + ex->setDecisionNum( m_decisionNumber ); + ex->setState(s); } } Modified: branches/tora3/extlibs/libantlr3cpp-3.5.1/include/antlr3exception.hpp =================================================================== --- branches/tora3/extlibs/libantlr3cpp-3.5.1/include/antlr3exception.hpp 2013-04-17 08:31:56 UTC (rev 4626) +++ branches/tora3/extlibs/libantlr3cpp-3.5.1/include/antlr3exception.hpp 2013-04-17 15:18:27 UTC (rev 4627) @@ -138,36 +138,36 @@ IntStreamType* m_input; public: - StringType& get_message(); - StringType& get_streamName(); - ANTLR_MARKER get_index() const; - const TokenType* get_token() const; - ExceptionBaseType* get_nextException() const; - ANTLR_UINT32 get_expecting() const; - BitsetListType* get_expectingSet() const; - TokenType* get_node() const; - ANTLR_UCHAR get_c() const; - ANTLR_UINT32 get_line() const; - ANTLR_INT32 get_charPositionInLine() const; - ANTLR_UINT32 get_decisionNum() const; - ANTLR_UINT32 get_state() const; - StringType& get_ruleName(); - IntStreamType* get_input() const; - void set_message( const StringType& message ); - void set_streamName( const StringType& streamName ); - void set_index( ANTLR_MARKER index ); - void set_token( const TokenType* token ); - void set_nextException( ExceptionBaseType* nextException ); - void set_expecting( ANTLR_UINT32 expecting ); - void set_expectingSet( BitsetListType* expectingSet ); - void set_node( TokenType* node ); - void set_c( ANTLR_UCHAR c ); - void set_line( ANTLR_UINT32 line ); - void set_charPositionInLine( ANTLR_INT32 charPositionInLine ); - void set_decisionNum( ANTLR_UINT32 decisionNum ); - void set_state( ANTLR_UINT32 state ); - void set_ruleName( const StringType& ruleName ); - void set_input( IntStreamType* input ); + StringType& getMessage(); + StringType& getStreamName(); + ANTLR_MARKER getIndex() const; + const TokenType* getToken() const; + ExceptionBaseType* getNextException() const; + ANTLR_UINT32 getExpecting() const; + BitsetListType* getExpectingSet() const; + TokenType* getNode() const; + ANTLR_UCHAR getC() const; + ANTLR_UINT32 getLine() const; + ANTLR_INT32 getCharPositionInLine() const; + ANTLR_UINT32 getDecisionNum() const; + ANTLR_UINT32 getState() const; + StringType& getRuleName(); + IntStreamType* getInput() const; + void setMessage( const StringType& message ); + void setStreamName( const StringType& streamName ); + void setIndex( ANTLR_MARKER index ); + void setToken( const TokenType* token ); + void setNextException( ExceptionBaseType* nextException ); + void setExpecting( ANTLR_UINT32 expecting ); + void setExpectingSet( BitsetListType* expectingSet ); + void setNode( TokenType* node ); + void setC( ANTLR_UCHAR c ); + void setLine( ANTLR_UINT32 line ); + void setCharPositionInLine( ANTLR_INT32 charPositionInLine ); + void setDecisionNum( ANTLR_UINT32 decisionNum ); + void setState( ANTLR_UINT32 state ); + void setRuleName( const StringType& ruleName ); + void setInput( IntStreamType* input ); StringType getDescription() const; virtual StringType getName() const = 0; Modified: branches/tora3/extlibs/libantlr3cpp-3.5.1/include/antlr3exception.inl =================================================================== --- branches/tora3/extlibs/libantlr3cpp-3.5.1/include/antlr3exception.inl 2013-04-17 08:31:56 UTC (rev 4626) +++ branches/tora3/extlibs/libantlr3cpp-3.5.1/include/antlr3exception.inl 2013-04-17 15:18:27 UTC (rev 4627) @@ -18,152 +18,152 @@ } template<class ImplTraits, class StreamType> -ANTLR_INLINE typename ANTLR_ExceptionBase<ImplTraits, StreamType>::StringType& ANTLR_ExceptionBase<ImplTraits, StreamType>::get_message() +ANTLR_INLINE typename ANTLR_ExceptionBase<ImplTraits, StreamType>::StringType& ANTLR_ExceptionBase<ImplTraits, StreamType>::getMessage() { return m_message; } template<class ImplTraits, class StreamType> -ANTLR_INLINE typename ANTLR_ExceptionBase<ImplTraits, StreamType>::StringType& ANTLR_ExceptionBase<ImplTraits, StreamType>::get_streamName() +ANTLR_INLINE typename ANTLR_ExceptionBase<ImplTraits, StreamType>::StringType& ANTLR_ExceptionBase<ImplTraits, StreamType>::getStreamName() { return m_streamName; } template<class ImplTraits, class StreamType> -ANTLR_INLINE ANTLR_MARKER ANTLR_ExceptionBase<ImplTraits, StreamType>::get_index() const +ANTLR_INLINE ANTLR_MARKER ANTLR_ExceptionBase<ImplTraits, StreamType>::getIndex() const { return m_index; } template<class ImplTraits, class StreamType> -ANTLR_INLINE const typename ANTLR_ExceptionBase<ImplTraits, StreamType>::TokenType* ANTLR_ExceptionBase<ImplTraits, StreamType>::get_token() const +ANTLR_INLINE const typename ANTLR_ExceptionBase<ImplTraits, StreamType>::TokenType* ANTLR_ExceptionBase<ImplTraits, StreamType>::getToken() const { return m_token; } template<class ImplTraits, class StreamType> -ANTLR_INLINE typename ANTLR_ExceptionBase<ImplTraits, StreamType>::ExceptionBaseType* ANTLR_ExceptionBase<ImplTraits, StreamType>::get_nextException() const +ANTLR_INLINE typename ANTLR_ExceptionBase<ImplTraits, StreamType>::ExceptionBaseType* ANTLR_ExceptionBase<ImplTraits, StreamType>::getNextException() const { return m_nextException; } template<class ImplTraits, class StreamType> -ANTLR_INLINE ANTLR_UINT32 ANTLR_ExceptionBase<ImplTraits, StreamType>::get_expecting() const +ANTLR_INLINE ANTLR_UINT32 ANTLR_ExceptionBase<ImplTraits, StreamType>::getExpecting() const { return m_expecting; } template<class ImplTraits, class StreamType> -ANTLR_INLINE typename ANTLR_ExceptionBase<ImplTraits, StreamType>::BitsetListType* ANTLR_ExceptionBase<ImplTraits, StreamType>::get_expectingSet() const +ANTLR_INLINE typename ANTLR_ExceptionBase<ImplTraits, StreamType>::BitsetListType* ANTLR_ExceptionBase<ImplTraits, StreamType>::getExpectingSet() const { return m_expectingSet; } template<class ImplTraits, class StreamType> -ANTLR_INLINE typename ANTLR_ExceptionBase<ImplTraits, StreamType>::TokenType* ANTLR_ExceptionBase<ImplTraits, StreamType>::get_node() const +ANTLR_INLINE typename ANTLR_ExceptionBase<ImplTraits, StreamType>::TokenType* ANTLR_ExceptionBase<ImplTraits, StreamType>::getNode() const { return m_node; } template<class ImplTraits, class StreamType> -ANTLR_INLINE ANTLR_UCHAR ANTLR_ExceptionBase<ImplTraits, StreamType>::get_c() const +ANTLR_INLINE ANTLR_UCHAR ANTLR_ExceptionBase<ImplTraits, StreamType>::getC() const { return m_c; } template<class ImplTraits, class StreamType> -ANTLR_INLINE ANTLR_UINT32 ANTLR_ExceptionBase<ImplTraits, StreamType>::get_line() const +ANTLR_INLINE ANTLR_UINT32 ANTLR_ExceptionBase<ImplTraits, StreamType>::getLine() const { return m_line; } template<class ImplTraits, class StreamType> -ANTLR_INLINE ANTLR_INT32 ANTLR_ExceptionBase<ImplTraits, StreamType>::get_charPositionInLine() const +ANTLR_INLINE ANTLR_INT32 ANTLR_ExceptionBase<ImplTraits, StreamType>::getCharPositionInLine() const { return m_charPositionInLine; } template<class ImplTraits, class StreamType> -ANTLR_INLINE ANTLR_UINT32 ANTLR_ExceptionBase<ImplTraits, StreamType>::get_decisionNum() const +ANTLR_INLINE ANTLR_UINT32 ANTLR_ExceptionBase<ImplTraits, StreamType>::getDecisionNum() const { return m_decisionNum; } template<class ImplTraits, class StreamType> -ANTLR_INLINE ANTLR_UINT32 ANTLR_ExceptionBase<ImplTraits, StreamType>::get_state() const +ANTLR_INLINE ANTLR_UINT32 ANTLR_ExceptionBase<ImplTraits, StreamType>::getState() const { return m_state; } template<class ImplTraits, class StreamType> -ANTLR_INLINE typename ANTLR_ExceptionBase<ImplTraits, StreamType>::StringType& ANTLR_ExceptionBase<ImplTraits, StreamType>::get_ruleName() +ANTLR_INLINE typename ANTLR_ExceptionBase<ImplTraits, StreamType>::StringType& ANTLR_ExceptionBase<ImplTraits, StreamType>::getRuleName() { return m_ruleName; } template<class ImplTraits, class StreamType> -ANTLR_INLINE typename ANTLR_ExceptionBase<ImplTraits, StreamType>::IntStreamType* ANTLR_ExceptionBase<ImplTraits, StreamType>::get_input() const +ANTLR_INLINE typename ANTLR_ExceptionBase<ImplTraits, StreamType>::IntStreamType* ANTLR_ExceptionBase<ImplTraits, StreamType>::getInput() const { return m_input; } template<class ImplTraits, class StreamType> -ANTLR_INLINE void ANTLR_ExceptionBase<ImplTraits, StreamType>::set_message( const StringType& message ) +ANTLR_INLINE void ANTLR_ExceptionBase<ImplTraits, StreamType>::setMessage( const StringType& message ) { m_message = message; } template<class ImplTraits, class StreamType> -ANTLR_INLINE void ANTLR_ExceptionBase<ImplTraits, StreamType>::set_streamName( const StringType& streamName ) +ANTLR_INLINE void ANTLR_ExceptionBase<ImplTraits, StreamType>::setStreamName( const StringType& streamName ) { m_streamName = streamName; } template<class ImplTraits, class StreamType> -ANTLR_INLINE void ANTLR_ExceptionBase<ImplTraits, StreamType>::set_index( ANTLR_MARKER index ) +ANTLR_INLINE void ANTLR_ExceptionBase<ImplTraits, StreamType>::setIndex( ANTLR_MARKER index ) { m_index = index; } template<class ImplTraits, class StreamType> -ANTLR_INLINE void ANTLR_ExceptionBase<ImplTraits, StreamType>::set_token( const TokenType* token ) +ANTLR_INLINE void ANTLR_ExceptionBase<ImplTraits, StreamType>::setToken( const TokenType* token ) { m_token = token; } template<class ImplTraits, class StreamType> -ANTLR_INLINE void ANTLR_ExceptionBase<ImplTraits, StreamType>::set_nextException( ExceptionBaseType* nextException ) +ANTLR_INLINE void ANTLR_ExceptionBase<ImplTraits, StreamType>::setNextException( ExceptionBaseType* nextException ) { m_nextException = nextException; } template<class ImplTraits, class StreamType> -ANTLR_INLINE void ANTLR_ExceptionBase<ImplTraits, StreamType>::set_expecting( ANTLR_UINT32 expecting ) +ANTLR_INLINE void ANTLR_ExceptionBase<ImplTraits, StreamType>::setExpecting( ANTLR_UINT32 expecting ) { m_expecting = expecting; } template<class ImplTraits, class StreamType> -ANTLR_INLINE void ANTLR_ExceptionBase<ImplTraits, StreamType>::set_expectingSet( BitsetListType* expectingSet ) +ANTLR_INLINE void ANTLR_ExceptionBase<ImplTraits, StreamType>::setExpectingSet( BitsetListType* expectingSet ) { m_expectingSet = expectingSet; } template<class ImplTraits, class StreamType> -ANTLR_INLINE void ANTLR_ExceptionBase<ImplTraits, StreamType>::set_node( TokenType* node ) +ANTLR_INLINE void ANTLR_ExceptionBase<ImplTraits, StreamType>::setNode( TokenType* node ) { m_node = node; } template<class ImplTraits, class StreamType> -ANTLR_INLINE void ANTLR_ExceptionBase<ImplTraits, StreamType>::set_c( ANTLR_UCHAR c ) +ANTLR_INLINE void ANTLR_ExceptionBase<ImplTraits, StreamType>::setC( ANTLR_UCHAR c ) { m_c = c; } template<class ImplTraits, class StreamType> -ANTLR_INLINE void ANTLR_ExceptionBase<ImplTraits, StreamType>::set_line( ANTLR_UINT32 line ) +ANTLR_INLINE void ANTLR_ExceptionBase<ImplTraits, StreamType>::setLine( ANTLR_UINT32 line ) { m_line = line; } template<class ImplTraits, class StreamType> -ANTLR_INLINE void ANTLR_ExceptionBase<ImplTraits, StreamType>::set_charPositionInLine( ANTLR_INT32 charPositionInLine ) +ANTLR_INLINE void ANTLR_ExceptionBase<ImplTraits, StreamType>::setCharPositionInLine( ANTLR_INT32 charPositionInLine ) { m_charPositionInLine = charPositionInLine; } template<class ImplTraits, class StreamType> -ANTLR_INLINE void ANTLR_ExceptionBase<ImplTraits, StreamType>::set_decisionNum( ANTLR_UINT32 decisionNum ) +ANTLR_INLINE void ANTLR_ExceptionBase<ImplTraits, StreamType>::setDecisionNum( ANTLR_UINT32 decisionNum ) { m_decisionNum = decisionNum; } template<class ImplTraits, class StreamType> -ANTLR_INLINE void ANTLR_ExceptionBase<ImplTraits, StreamType>::set_state( ANTLR_UINT32 state ) +ANTLR_INLINE void ANTLR_ExceptionBase<ImplTraits, StreamType>::setState( ANTLR_UINT32 state ) { m_state = state; } template<class ImplTraits, class StreamType> -ANTLR_INLINE void ANTLR_ExceptionBase<ImplTraits, StreamType>::set_ruleName( const StringType& ruleName ) +ANTLR_INLINE void ANTLR_ExceptionBase<ImplTraits, StreamType>::setRuleName( const StringType& ruleName ) { m_ruleName = ruleName; } template<class ImplTraits, class StreamType> -ANTLR_INLINE void ANTLR_ExceptionBase<ImplTraits, StreamType>::set_input( IntStreamType* input ) +ANTLR_INLINE void ANTLR_ExceptionBase<ImplTraits, StreamType>::setInput( IntStreamType* input ) { m_input = input; } Modified: branches/tora3/extlibs/libantlr3cpp-3.5.1/include/antlr3intstream.inl =================================================================== --- branches/tora3/extlibs/libantlr3cpp-3.5.1/include/antlr3intstream.inl 2013-04-17 08:31:56 UTC (rev 4626) +++ branches/tora3/extlibs/libantlr3cpp-3.5.1/include/antlr3intstream.inl 2013-04-17 15:18:27 UTC (rev 4627) @@ -1486,7 +1486,7 @@ if (tok != NULL) { - return tok->get_type(); + return tok->getType(); } else { Modified: branches/tora3/extlibs/libantlr3cpp-3.5.1/include/antlr3lexer.inl =================================================================== --- branches/tora3/extlibs/libantlr3cpp-3.5.1/include/antlr3lexer.inl 2013-04-17 08:31:56 UTC (rev 4626) +++ branches/tora3/extlibs/libantlr3cpp-3.5.1/include/antlr3lexer.inl 2013-04-17 15:18:27 UTC (rev 4627) @@ -50,36 +50,36 @@ } else { - err_stream << ex->get_streamName().c_str(); + err_stream << ex->getStreamName().c_str(); err_stream << "("; } - err_stream << ex->get_line() << ")"; + err_stream << ex->getLine() << ")"; err_stream << ": lexer error " << ex->getType() << " :\n\t" - << ex->get_message() << " at offset " - << ex->get_charPositionInLine()+1 << ", "; + << ex->getMessage() << " at offset " + << ex->getCharPositionInLine()+1 << ", "; { ANTLR_UINT32 width; width = ANTLR_UINT32_CAST(( (ANTLR_UINT8*)(m_input->get_data()) + - (m_input->size() )) - (ANTLR_UINT8*)( ex->get_index() )); + (m_input->size() )) - (ANTLR_UINT8*)( ex->getIndex() )); if (width >= 1) { - if (isprint(ex->get_c() )) + if (isprint(ex->getC() )) { - err_stream << "near '" << ex->get_c() << "' :\n"; + err_stream << "near '" << ex->getC() << "' :\n"; } else { char tmp[128]; - sprintf( tmp, "near char(%#02X) :\n", ex->get_c() ); + sprintf( tmp, "near char(%#02X) :\n", ex->getC() ); err_stream << tmp; } err_stream << "\t"; err_stream.width( width > 20 ? 20 : width ); - err_stream << ex->get_index() << "\n"; + err_stream << ex->getIndex() << "\n"; } else { @@ -110,12 +110,12 @@ template<class ImplTraits> void Lexer<ImplTraits>::fillExceptionData( ExceptionBaseType* ex ) { - ex->set_c( m_input->_LA(1) ); /* Current input character */ - ex->set_line( m_input->get_line() ); /* Line number comes from stream */ - ex->set_charPositionInLine( m_input->get_charPositionInLine() ); /* Line offset also comes from the stream */ - ex->set_index( m_input->index() ); - ex->set_streamName( m_input->get_fileName() ); - ex->set_message( "Unexpected character" ); + ex->setC( m_input->_LA(1) ); /* Current input character */ + ex->setLine( m_input->get_line() ); /* Line number comes from stream */ + ex->setCharPositionInLine( m_input->get_charPositionInLine() ); /* Line offset also comes from the stream */ + ex->setIndex( m_input->index() ); + ex->setStreamName( m_input->get_fileName() ); + ex->setMessage( "Unexpected character" ); } template<class ImplTraits> @@ -197,21 +197,21 @@ RecognizerSharedStateType* state = this->get_rec()->get_state(); state->set_token_present(true); CommonTokenType* token = state->get_token(); - token->set_input( this->get_input() ); + token->setInput( this->get_input() ); /* Install the supplied information, and some other bits we already know * get added automatically, such as the input stream it is associated with * (though it can all be overridden of course) */ - token->set_type( state->get_type() ); - token->set_channel( state->get_channel() ); - token->set_startIndex( state->get_tokenStartCharIndex() ); - token->set_stopIndex( this->getCharIndex() - 1 ); - token->set_line( state->get_tokenStartLine() ); - token->set_charPositionInLine( state->get_tokenStartCharPositionInLine() ); + token->setType( state->get_type() ); + token->setChannel( state->get_channel() ); + token->setStartIndex( state->get_tokenStartCharIndex() ); + token->setStopIndex( this->getCharIndex() - 1 ); + token->setLine( state->get_tokenStartLine() ); + token->setCharPositionInLine( state->get_tokenStartCharPositionInLine() ); - token->set_tokText( state->get_text() ); - token->set_lineStart( this->get_input()->get_currentLine() ); + token->setTokText( state->get_text() ); + token->setLineStart( this->get_input()->get_currentLine() ); return token; } Modified: branches/tora3/extlibs/libantlr3cpp-3.5.1/include/antlr3parser.inl =================================================================== --- branches/tora3/extlibs/libantlr3cpp-3.5.1/include/antlr3parser.inl 2013-04-17 08:31:56 UTC (rev 4626) +++ branches/tora3/extlibs/libantlr3cpp-3.5.1/include/antlr3parser.inl 2013-04-17 15:18:27 UTC (rev 4627) @@ -52,19 +52,19 @@ template< class ImplTraits > void Parser<ImplTraits>::fillExceptionData( ExceptionBaseType* ex ) { - ex->set_token( m_tstream->_LT(1) ); /* Current input token */ - ex->set_line( ex->get_token()->get_line() ); - ex->set_charPositionInLine( ex->get_token()->get_charPositionInLine() ); - ex->set_index( this->get_istream()->index() ); - if( ex->get_token()->get_type() == CommonTokenType::TOKEN_EOF) + ex->setToken( m_tstream->_LT(1) ); /* Current input token */ + ex->setLine( ex->getToken()->getLine() ); + ex->setCharPositionInLine( ex->getToken()->getCharPositionInLine() ); + ex->setIndex( this->get_istream()->index() ); + if( ex->getToken()->getType() == CommonTokenType::TOKEN_EOF) { - ex->set_streamName(""); + ex->setStreamName(""); } else { - ex->set_streamName( ex->get_token()->get_input()->get_fileName() ); + ex->setStreamName( ex->getToken()->getInput()->get_fileName() ); } - ex->set_message("Unexpected token"); + ex->setMessage("Unexpected token"); } template< class ImplTraits > @@ -73,9 +73,9 @@ typename ImplTraits::StringStreamType errtext; // See if there is a 'filename' we can use // - if( ex->get_streamName().empty() ) + if( ex->getStreamName().empty() ) { - if(ex->get_token()->get_type() == CommonTokenType::TOKEN_EOF) + if(ex->getToken()->getType() == CommonTokenType::TOKEN_EOF) { errtext << "-end of input-("; } @@ -86,26 +86,26 @@ } else { - errtext << ex->get_streamName() << "("; + errtext << ex->getStreamName() << "("; } // Next comes the line number // - errtext << this->get_rec()->get_state()->get_exception()->get_line() << ") "; + errtext << this->get_rec()->get_state()->get_exception()->getLine() << ") "; errtext << " : error " << this->get_rec()->get_state()->get_exception()->getType() << " : " - << this->get_rec()->get_state()->get_exception()->get_message(); + << this->get_rec()->get_state()->get_exception()->getMessage(); // Prepare the knowledge we know we have // - const CommonTokenType* theToken = this->get_rec()->get_state()->get_exception()->get_token(); + const CommonTokenType* theToken = this->get_rec()->get_state()->get_exception()->getToken(); StringType ttext = theToken->toString(); errtext << ", at offset , " - << this->get_rec()->get_state()->get_exception()->get_charPositionInLine(); + << this->get_rec()->get_state()->get_exception()->getCharPositionInLine(); if (theToken != NULL) { - if (theToken->get_type() == CommonTokenType::TOKEN_EOF) + if (theToken->getType() == CommonTokenType::TOKEN_EOF) { errtext << ", at <EOF>"; } @@ -206,7 +206,7 @@ // If we are at EOF, we use the token before EOF // current = cts->_LT(1); - if (current->get_type() == CommonTokenType::TOKEN_EOF) + if (current->getType() == CommonTokenType::TOKEN_EOF) { current = cts->_LT(-1); } @@ -215,11 +215,11 @@ // Set some of the token properties based on the current token // - token->set_line(current->get_line()); - token->set_charPositionInLine( current->get_charPositionInLine()); - token->set_channel( TOKEN_DEFAULT_CHANNEL ); - token->set_type(expectedTokenType); - token->set_lineStart( current->get_lineStart() ); + token->setLine(current->getLine()); + token->setCharPositionInLine( current->getCharPositionInLine()); + token->setChannel( TOKEN_DEFAULT_CHANNEL ); + token->setType(expectedTokenType); + token->setLineStart( current->getLineStart() ); // Create the token text that shows it has been inserted // Modified: branches/tora3/extlibs/libantlr3cpp-3.5.1/include/antlr3tokenstream.inl =================================================================== --- branches/tora3/extlibs/libantlr3cpp-3.5.1/include/antlr3tokenstream.inl 2013-04-17 08:31:56 UTC (rev 4626) +++ branches/tora3/extlibs/libantlr3cpp-3.5.1/include/antlr3tokenstream.inl 2013-04-17 15:18:27 UTC (rev 4627) @@ -89,9 +89,9 @@ // TokenType& teof = m_eofToken; - teof.set_startIndex(lexer->getCharIndex()); - teof.set_stopIndex(lexer->getCharIndex()); - teof.set_line(lexer->getLine()); + teof.setStartIndex(lexer->getCharIndex()); + teof.setStopIndex(lexer->getCharIndex()); + teof.setLine(lexer->getLine()); return &teof; } @@ -233,7 +233,7 @@ // that isn't EOF or we reach the actual end of the last input // stream on the stack. // - while(tok->get_type() == CommonTokenType::TOKEN_EOF) + while(tok->getType() == CommonTokenType::TOKEN_EOF) { typename ImplTraits::LexerType* lexer; lexer = static_cast<typename ImplTraits::LexerType*>( this->get_super() ); @@ -419,8 +419,8 @@ { TokenType& teof = cts->get_tokenSource()->get_eofToken(); - teof.set_startIndex( this->get_istream()->index()); - teof.set_stopIndex( this->get_istream()->index()); + teof.setStartIndex( this->get_istream()->index()); + teof.setStopIndex( this->get_istream()->index()); return &teof; } @@ -444,8 +444,8 @@ { TokenType& teof = cts->get_tokenSource()->get_eofToken(); - teof.set_startIndex(this->get_istream()->index()); - teof.set_stopIndex(this->get_istream()->index()); + teof.setStartIndex(this->get_istream()->index()); + teof.setStopIndex(this->get_istream()->index()); return &teof; } @@ -701,7 +701,7 @@ tok = this->get(i); if ( types == NULL - || (types->isMember( tok->get_type() ) == true ) + || (types->isMember( tok->getType() ) == true ) ) { filteredList.push_back(tok); @@ -776,7 +776,7 @@ */ tok = this->get_tokenSource()->nextToken(); - while ( tok->get_type() != TokenType::TOKEN_EOF ) + while ( tok->getType() != TokenType::TOKEN_EOF ) { discard = false; /* Assume we are not discarding */ @@ -786,12 +786,12 @@ * we can distinguish "not being there" from "being channel or type 0" */ - if ( m_discardSet.find(tok->get_type()) != m_discardSet.end() ) + if ( m_discardSet.find(tok->getType()) != m_discardSet.end() ) { discard = true; } else if ( m_discardOffChannel == true - && tok->get_channel() != m_channel + && tok->getChannel() != m_channel ) { discard = true; @@ -800,13 +800,13 @@ { /* See if this type is in the override map */ - typename ChannelOverridesType::iterator iter = m_channelOverrides.find( tok->get_type() + 1 ); + typename ChannelOverridesType::iterator iter = m_channelOverrides.find( tok->getType() + 1 ); if (iter != m_channelOverrides.end()) { /* Override found */ - tok->set_channel( ANTLR_UINT32_CAST(iter->second) - 1); + tok->setChannel( ANTLR_UINT32_CAST(iter->second) - 1); } } @@ -816,7 +816,7 @@ { /* Add it, indicating that we will delete it and the table should not */ - tok->set_tokenIndex(index); + tok->setTokenIndex(index); ++m_p; this->insertToken(*tok); index++; @@ -855,7 +855,7 @@ { const TokenType* tok = this->getToken(i); - if (tok->get_channel() != m_channel ) + if (tok->getChannel() != m_channel ) { i++; } @@ -874,7 +874,7 @@ { const TokenType* tok = this->getToken(x); - if( tok->get_channel() != m_channel ) + if( tok->getChannel() != m_channel ) { x--; } Modified: branches/tora3/extlibs/parsing.cpp/Makefile =================================================================== --- branches/tora3/extlibs/parsing.cpp/Makefile 2013-04-17 08:31:56 UTC (rev 4626) +++ branches/tora3/extlibs/parsing.cpp/Makefile 2013-04-17 15:18:27 UTC (rev 4627) @@ -18,7 +18,7 @@ TOBJS= utils.o -all: t0 m0 p0 +all: t0 m0 p0 s0 $(ANTLR): org/antlr/codegen/templates/Cpp/Cpp.stg \ org/antlr/codegen/templates/Cpp/AST.stg \ Modified: branches/tora3/extlibs/parsing.cpp/antlr-complete-3.5.1-SNAPSHOT.jar =================================================================== (Binary files differ) Modified: branches/tora3/extlibs/parsing.cpp/org/antlr/codegen/templates/Cpp/AST.stg =================================================================== --- branches/tora3/extlibs/parsing.cpp/org/antlr/codegen/templates/Cpp/AST.stg 2013-04-17 08:31:56 UTC (rev 4626) +++ branches/tora3/extlibs/parsing.cpp/org/antlr/codegen/templates/Cpp/AST.stg 2013-04-17 15:18:27 UTC (rev 4627) @@ -59,6 +59,10 @@ @returnScope.ruleReturnMembers() ::= << <super.ASTLabelType()> tree; <super.ASTLabelType()> getTree() { return tree; } +void init () +{ + tree = NULL; +} >> /** Add a variable to track rule's return AST */ @@ -299,7 +303,7 @@ <root:rewriteElement()> <children:rewriteElement()> TreeAdaptorType::addChild(root_<enclosingTreeLevel>, root_<treeLevel>); -}<\n> +} >> rewriteElementList(elements) ::= "<elements:rewriteElement()>" Modified: branches/tora3/extlibs/parsing.cpp/org/antlr/codegen/templates/Cpp/ASTParser.stg =================================================================== --- branches/tora3/extlibs/parsing.cpp/org/antlr/codegen/templates/Cpp/ASTParser.stg 2013-04-17 08:31:56 UTC (rev 4626) +++ branches/tora3/extlibs/parsing.cpp/org/antlr/codegen/templates/Cpp/ASTParser.stg 2013-04-17 15:18:27 UTC (rev 4627) @@ -39,8 +39,9 @@ */ @rule.setErrorReturnValue() ::= << -retval.tree = (<ASTLabelType>)TreeAdaptorType::errorNode(input, retval.start, input.LT(-1), re);<! - System.out.println("<ruleName> returns "+((CommonTree)retval.tree).toStringTree()); !> +//TODO +//retval.tree = (<ASTLabelType>)TreeAdaptorType::errorNode(input, retval.start, input.LT(-1)); +retval.tree = (<ASTLabelType>)TreeAdaptorType::errorNode(NULL, retval.start, LT(-1)); >> // TOKEN AST STUFF Modified: branches/tora3/extlibs/parsing.cpp/org/antlr/codegen/templates/Cpp/Cpp.stg =================================================================== --- branches/tora3/extlibs/parsing.cpp/org/antlr/codegen/templates/Cpp/Cpp.stg 2013-04-17 08:31:56 UTC (rev 4626) +++ branches/tora3/extlibs/parsing.cpp/org/antlr/codegen/templates/Cpp/Cpp.stg 2013-04-17 15:18:27 UTC (rev 4627) @@ -384,7 +384,11 @@ /** Context tracking structure for <mainName()> */ -class <name> : public <componentBaseType()>, public <name>Tokens, <name>ImplTraits::TreeAdaptorType +class <name> : public <componentBaseType()> + , public <name>Tokens +<if(PARSER)> + , <name>ImplTraits::TreeAdaptorType +<endif> { public: typedef <name>ImplTraits ImplTraits; @@ -393,8 +397,10 @@ typedef <componentBaseType()> BaseType; typedef ImplTraits::RecognizerSharedStateType\<StreamType> RecognizerSharedStateType; typedef StreamType InputType; - typedef typename ImplTraits::CommonTokenType CommonTokenType; - typedef typename ImplTraits::TreeAdaptorType TreeAdaptorType; +<if(PARSER)> + typedef <name>ImplTraits::CommonTokenType CommonTokenType; + typedef <name>ImplTraits::TreeAdaptorType TreeAdaptorType; +<endif> <if(recognizer.filterMode)> static const bool IsFiltered = true; @@ -434,7 +440,7 @@ <if(recognizer.filterMode)> void memoize(ANTLR_MARKER ruleIndex, ANTLR_MARKER ruleParseStart); bool alreadyParsedRule(ANTLR_MARKER ruleIndex); - <filteringNextToken()> // Copied from Java Target byIvan + <filteringNextToken()> <endif> <rules:{r | <if(!r.ruleDescriptor.isSynPred)><headerReturnType(ruleDescriptor=r.ruleDescriptor)> m<r.ruleDescriptor.name>( <r.ruleDescriptor.parameterScope:parameterScope()>);<endif>}; separator="\n"> <rules:{r | <if(r.ruleDescriptor.isSynPred)> <headerReturnType(ruleDescriptor=r.ruleDescriptor)> msynpred( antlr3::ClassForwarder\< <r.ruleDescriptor.name> > <r.ruleDescriptor.parameterScope:parameterScope()>); @@ -564,7 +570,7 @@ numRules, filterMode, superClass, - labelType="ImplTraits::CommonTokenType*") ::= << + labelType="const ImplTraits::CommonTokenType*") ::= << using namespace antlr3; @@ -1029,7 +1035,7 @@ bitsets, ASTLabelType, superClass="Parser", - labelType="CommonTokenType*", + labelType="const CommonTokenType*", members={<actions.parser.members>} ) ::= << <beginNamespace(actions)> @@ -1069,7 +1075,7 @@ */ synpredRule(ruleName, ruleDescriptor, block, description, nakedBlock) ::= << -// $ANTLR start <ruleName> +// $ANTLR start synpredRule <ruleName> void <name>::m<ruleName>_fragment( <ruleDescriptor.parameterScope:parameterScope()> ) { <ruleLabelDefs()> @@ -1082,9 +1088,11 @@ <else> <block> <endif> -<ruleCleanUp()> + +goto rule<ruleDescriptor.name>Ex; /* Prevent compiler warnings */ +rule<ruleDescriptor.name>Ex: ; } -// $ANTLR end <ruleName> +// $ANTLR end synpredRule <ruleName> >> synpred(predname) ::= << @@ -1280,25 +1288,20 @@ >> ruleLabelDefs() ::= << -<[ruleDescriptor.tokenLabels,ruleDescriptor.tokenListLabels] - :{it |<labelType> <it.label.text>;}; separator="\n" +<[ruleDescriptor.tokenLabels,ruleDescriptor.tokenListLabels, + ruleDescriptor.wildcardTreeLabels,ruleDescriptor.wildcardTreeListLabels] + :{it |<labelType> <it.label.text> = NULL;}; separator="\n" > -<[ruleDescriptor.tokenListLabels,ruleDescriptor.ruleListLabels] - :{it | VectorType\<const CommonTokenType*> list_<it.label.text>;}; separator="\n" +<[ruleDescriptor.tokenListLabels,ruleDescriptor.ruleListLabels,ruleDescriptor.wildcardTreeListLabels] + :{it |List\<Object> list_<it.label.text> = NULL;}; separator="\n" > <ruleDescriptor.ruleLabels:ruleLabelDef(); separator="\n"> >> ruleLabelInitializations() ::= << -<[ruleDescriptor.tokenLabels,ruleDescriptor.tokenListLabels] - :{it |<it.label.text> = NULL;}; separator="\n" -> -<[ruleDescriptor.ruleLabels,ruleDescriptor.ruleListLabels] - :ruleLabelInitVal(); separator="\n" -> <if(ruleDescriptor.hasMultipleReturnValues)> <if(!ruleDescriptor.isSynPred)> -retval.call_start_placeholder(); <\n> +retval.call_start_placeholder(); <endif> <endif> >> @@ -1691,7 +1694,7 @@ mismatchedSetEx() ::= << new ANTLR_Exception\< <name>ImplTraits, MISMATCHED_SET_EXCEPTION, StreamType>( this->get_rec(), "" ); <if(PARSER)> -this->get_exception()->set_expectingSet(NULL); +this->get_exception()->setExpectingSet(NULL); <! use following code to make it recover inline; this->get_exception()->set_expectingSet( &FOLLOW_set_in_<ruleName><elementIndex> ); !> @@ -1888,8 +1891,8 @@ newNVException() ::= << ExceptionBaseType* ex = new ANTLR_Exception\< <name>ImplTraits, NO_VIABLE_ALT_EXCEPTION, StreamType>( this->get_rec(), "<description>" ); -ex->set_decisionNum( <decisionNumber> ); -ex->set_state( <stateNumber> ); +ex->setDecisionNum( <decisionNumber> ); +ex->setState( <stateNumber> ); <@noViableAltException()> <\n> >> @@ -2144,8 +2147,8 @@ } <endif> ExceptionBaseType* ex = new ANTLR_Exception\< <name>ImplTraits, NO_VIABLE_ALT_EXCEPTION, StreamType>( recognizer, "<dfa.description>" ); - ex->set_decisionNum( <dfa.decisionNumber> ); - ex->set_state(_s); + ex->setDecisionNum( <dfa.decisionNumber> ); + ex->setState(_s); <@noViableAltException()> return -1; } @@ -2383,16 +2386,16 @@ <name>ImplTraits::<recognizer.ASTLabelType> stop; <endif> <@ruleReturnMembers()> - <ruleDescriptor.returnScope.attributes:{it |<it.type> <it.name>;}; separator="\n"> + <ruleDescriptor.returnScope.attributes:{it |<it.type> <it.name>;}; separator="\n"> <if(!TREE_PARSER)> - <ruleDescriptor:returnStructName()>() {} - <ruleDescriptor:returnStructName()>( BaseParserType* parser ) : BaseType(parser) {} + <ruleDescriptor:returnStructName()>() { init(); } + <ruleDescriptor:returnStructName()>( BaseParserType* parser ) : BaseType(parser) { init(); } <ruleDescriptor:returnStructName()>( const <ruleDescriptor:returnStructName()>& n ) : BaseType(n) <if(ruleDescriptor.returnScope.attributes)> , <ruleDescriptor.returnScope.attributes:{it | <it.name>(n.<it.name>) }; separator=","> <endif> - {} + { init(); } <ruleDescriptor:returnStructName()>& operator=( const <ruleDescriptor:returnStructName()>& n ) @@ -2423,7 +2426,7 @@ <endif> -};<\n><\n> +}; <endif> <endif> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |