dcsimg
Custom AST generating page fault
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Marc_Fiammante
Posted On:   Thursday, November 15, 2001 01:01 AM

I am trying to use Custom AST but I am getting an invalid memory access I am compiling with Visual C++ 6.0 under Windows 2000. Thank you for helping debug. To try I tested using the provided CommonAST by adding the following to exprAST.g (example in doc does not work) header ""post_include_hpp"" { #include ""antlr/CommonAST.hpp"" } ..... options { ... buildAST=true; ASTLabelType = ""antlr::RefCommonAST""; // change default of ""AST"" } In the Main I have parser.setASTNodeFactory(&CommonAST::factory); parser.expr(); // fail   More>>

I am trying to use Custom AST but I am getting an invalid memory access
I am compiling with Visual C++ 6.0 under Windows 2000. Thank you for helping debug.


To try I tested using the provided CommonAST by adding the following to exprAST.g (example in doc does not work)

			
header ""post_include_hpp"" {
#include ""antlr/CommonAST.hpp""

}
.....
options {

...
buildAST=true;
ASTLabelType = ""antlr::RefCommonAST""; // change default of ""AST""

}

In the Main I have
parser.setASTNodeFactory(&CommonAST::factory);

parser.expr(); // fails here with test.in in TokenBuffer

....

void TokenBuffer::fill(int amount)
{
RefToken t;
syncConsume();
// Fill the buffer sufficiently to hold needed tokens
while (queue.entries() < amount + markerOffset) {
// Append the next token
t=input.nextToken(); // Fails here


Any clues welcome.    <<Less

Re: Custom AST generating page fault

Posted By:   Marc_Fiammante  
Posted On:   Thursday, November 15, 2001 01:08 AM

With test.in I am getting the page fault using Visual C++ 6.0 debugger.


I am getting page faults in all cases with other custom ASTs


With CommonAST outside of the debugger I am getting ""null AST"" with the following code :


parser.expr();
RefCommonAST ast = RefCommonAST(parser.getAST());

if (ast) {

cout << ast->toStringList() << endl;

} else {

cout << ""null AST"" << endl;
}
About | Sitemap | Contact