[antlr-interest] Tree Grammar (Beginner doubt/problem)

Vinicius Durelli vinicius.durelli at gmail.com
Fri Feb 18 07:35:06 PST 2011


Hi, I have created a lexer and a parser for a rather simple DSL. A snippet
of this DSL that I am using for testing my lexer/parser is attached
(snippet.txt).
However, when it comes to evaluating the AST generated by my parser, my tree
grammar does not work properly. To be more specific, it stops parsing at
rule:

body : ^(MUTANTSNODE mutant*)
;

I have created grammars for lexers and parsers before, but tree grammars are
pretty new to my. Thus, any help on how to fix this problem (I am sure it
must be something quite simple, I do not have a clue though) would be
appreciated.
Attached you will find both grammars and the foregoing snippet that I am
using for testing purposes.

I can provide more details if needed.
For your time, thanks.

Regards,
Vinicius Durelli
-------------- next part --------------
[original] {
     id := "int HelloMaxine.fooBarFirstOne(int, float) "
     [before:1] {
          snapshot := {}
     }
     [before:2] {
          snapshot := {
	  "40";
	  "0";
	}
     }
     [after:1] {
          snapshot := {}
     }
     [after:2] {
          snapshot := {
	  "40";
	  "4657.3";
	}
     }
     [mutant] {
        id := "int HelloMaxine.fooBar$Mutant_2(int a, float f) "
		snapshot <- {
		  "4";
		  "4657.3";
		}
		state <- DEAD("return value different from the original method's")
     }
     [mutant] {
        id := "int HelloMaxine.fooBar$Mutant_3(int a, float f) "
		snapshot <- {
		  "40";
		  "4657.3";
		}
		state <- LIVE
     }
     [mutant] {
        id := "int HelloMaxine.fooBar$Mutant_4(int a, float f) "
		snapshot <- {
		  "40";
		  "4657.3";
		}
		state <- EQUIV
     }
}
[original] {
     id:="int HelloMaxine.fooBarEmpty2(int, float) "	
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Eval.g
Type: application/octet-stream
Size: 388 bytes
Desc: not available
Url : http://www.antlr.org/pipermail/antlr-interest/attachments/20110218/a8229c06/attachment.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Project.g
Type: application/octet-stream
Size: 21530 bytes
Desc: not available
Url : http://www.antlr.org/pipermail/antlr-interest/attachments/20110218/a8229c06/attachment-0001.obj 


More information about the antlr-interest mailing list