Skip to content

Commit

Permalink
2005-02-04 Adrian Pop, adrpo@ida.liu.se
Browse files Browse the repository at this point in the history
fixed so it compiles with new the new changes in modelica_parser


git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@1463 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adrpo committed Feb 4, 2005
1 parent ebd6f26 commit 7dba72e
Showing 1 changed file with 23 additions and 16 deletions.
39 changes: 23 additions & 16 deletions modelica_parser/test/parser/test_parser.cpp
@@ -1,11 +1,17 @@

#include <antlr/Token.hpp>
#include "antlr/ANTLRException.hpp"

#include "modelica_lexer.hpp"
#include "modelica_parser.hpp"
#include "parse_tree_dumper.hpp"

#include <antlr/Token.hpp>
#include "antlr/ANTLRException.hpp"
#include "antlr/CharStreamException.hpp"
#include "antlr/TokenStreamException.hpp"
#include "antlr/RecognitionException.hpp"
#include "antlr/NoViableAltException.hpp"
#include "antlr/MismatchedTokenException.hpp"
#include "antlr/TokenStreamRecognitionException.hpp"
#include "antlr/ASTFactory.hpp"
#include "MyAST.h"

#include <cstdlib>
#include <fstream>
Expand All @@ -31,24 +37,25 @@ int main(int argc, char* argv[])

try
{
ANTLR_USE_NAMESPACE(antlr)ASTFactory my_factory( "MyAST", MyAST::factory );
modelica_lexer lexer(file);
lexer.setFilename(argv[1]);

modelica_parser parser(lexer);

parser.initializeASTFactory(my_factory);
parser.setASTFactory (&my_factory);
parser.stored_definition();

parse_tree_dumper dumper(std::cout);
if (std::string(argv[0]) == "dot_parser")
{
dumper.dump_dot(parser.getAST());
}
else
{
dumper.dump(parser.getAST());
}


//parse_tree_dumper dumper(std::cout);
//if (std::string(argv[0]) == "dot_parser")
//{
// dumper.dump_dot(parser.getAST());
//}
//else
//{
// dumper.dump(parser.getAST());
//}
}
catch (ANTLR_USE_NAMESPACE(antlr)ANTLRException &e)
{
Expand Down

0 comments on commit 7dba72e

Please sign in to comment.