Doh... I'm pretty sure I tried that first, but yeah, backslash works fine.
Thanks! -Alex On Fri, Sep 11, 2009 at 3:34 PM, Terence Parr <[email protected]> wrote: > try \$eq :) > Ter > On Sep 11, 2009, at 11:12 AM, Alex Eagle wrote: > >> Hi Terrance and others, >> >> I'm using ANTLR3, and in my tree grammar I'm assembling an object >> model in Scala. When I add elements to a >> scala.collection.mutable.Buffer, there's a method in scala "+=" which >> is emitted into java bytecode as "$plus$eq". >> >> So my grammar has chunks like this: >> importDeclaration >> : ^('import' name=qualifiedType) >> { $SourceFile::file.imports().$plus$eq($name.text); } >> ; >> >> The problem is that antlr gets upset about the "$plus" and "$eq" and >> prints errors: >> error(114): >> /Users/alexeagle/IdeaProjects/noop/src/main/antlr/NoopAST.g:72:2: >> attribute is not a token, parameter, or return value: eq >> error(114): >> /Users/alexeagle/IdeaProjects/noop/src/main/antlr/NoopAST.g:77:2: >> attribute is not a token, parameter, or return value: plus >> >> But, the grammar is still generated and works fine. So it's just annoying. >> >> I've tried to find a way to escape those dollar signs, but no luck. Any >> ideas? >> >> Thanks! >> -Alex >> >> List: http://www.antlr.org/mailman/listinfo/antlr-interest >> Unsubscribe: >> http://www.antlr.org/mailman/options/antlr-interest/your-email-address > > List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "il-antlr-interest" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/il-antlr-interest?hl=en -~----------~----~----~----~------~----~------~--~---
