[antlr-interest] any comments on Mantra?

Terence Parr parrt at cs.usfca.edu
Sat Oct 13 10:56:34 PDT 2007


On Oct 13, 2007, at 10:15 AM, Rob Finneran wrote:

> Hi ANTLR Animals,
>
> Forgive me if this is a little off-topic:
>
> Can Mantra make instances of Java classes, access their fields, call
> their methods?
> How about calling static methods on Java classes.

Sure.  use "java {...}" in classes, methods, or expressions.  Any  
time i need a construct missing in mantra, i drop into java to  
implement it.

class T {
	java {...}
	foo() {
		java {System.out.println("...");}
		int i  = {Integer.parseInt("34")};
	}
}

> Does Mantra support RegEx expressions and easy file processing?

Library is just beginning, but it's easy to access java underneath.   
It has some good file stuff .  Check out the examples like:

File("coffee") => Lines() => grep(".*parrt.*");

where => is pipe like unix pipe 'cept it passes objects.

Ter


More information about the antlr-interest mailing list