[antlr-interest] any comments on Mantra?

Rob Finneran robfinneran at gmail.com
Sat Oct 13 20:32:45 PDT 2007


Ah, this works because it is a translator and not a compiler or interpreter.

On 10/13/07, Terence Parr <parrt at cs.usfca.edu> wrote:
>
> 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