Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/ParseNode.h

    re994912 r3a5131ed  
    1010// Created On       : Sat May 16 13:28:16 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Feb  9 14:45:28 2017
    13 // Update Count     : 658
     12// Last Modified On : Thu Feb 16 13:15:55 2017
     13// Update Count     : 661
    1414//
    1515
     
    3939//##############################################################################
    4040
     41extern char* yyfilename;
     42extern int yylineno;
     43
    4144class ParseNode {
    4245  public:
     
    6568        ParseNode * next = nullptr;
    6669        std::string * name = nullptr;
     70        CodeLocation location = { yyfilename, yylineno };
    6771}; // ParseNode
    6872
     
    410414        while ( cur ) {
    411415                try {
    412 //                      SynTreeType * result = dynamic_cast< SynTreeType * >( maybeBuild< typename std::result_of< decltype(&NodeType::build)(NodeType)>::type >( cur ) );
    413416                        SynTreeType * result = dynamic_cast< SynTreeType * >( maybeBuild< typename std::pointer_traits< decltype(cur->build())>::element_type >( cur ) );
    414417                        if ( result ) {
     418                                result->location = cur->location;
    415419                                * out++ = result;
    416420                        } // if
    417421                } catch( SemanticError &e ) {
     422                        e.set_location( cur->location );
    418423                        errors.append( e );
    419424                } // try
     
    432437template< typename SynTreeType, typename NodeType >
    433438void buildMoveList( const NodeType * firstNode, std::list< SynTreeType * > &outputList ) {
    434         buildList(firstNode, outputList);
     439        buildList( firstNode, outputList );
    435440        delete firstNode;
    436441}
Note: See TracChangeset for help on using the changeset viewer.