antlr
Better way to map tokens to enum values?
I\'m trying to have my parser rule select an enum value based on my DIR token. Is there a way I can do this without creating separate, full-fledged tokens for each direction? Or generally a cleaner ap[详细]
2023-04-04 01:21 分类:问答Parsing a templating language
I\'m trying to parse a templating language and I\'m having trouble correctly parsing the arbitrary html that can appear between tags. So far what I have is below, any suggestions? An example of a vali[详细]
2023-04-03 22:30 分类:问答ANTLR grammar not handling my "not" operator correctly
I am trying to parse a small expression language (I didn\'t define the language, from a vendor) and everything is fine until I try to use the not operator, which is a tilde in this language.[详细]
2023-04-03 19:56 分类:问答All ANTLR grammars produce error "no viable alternative at input '<EOF>'"
I am needing to parse a small expression language (and, or, not, parens change precedence) so picked ANTLR for the task, I made good progress (ANTLRWorks is very nice for a newbie). I used some Gettin[详细]
2023-04-03 00:59 分类:问答Tracking down problems with text being ignored by ANTLR parser
I\'m working on a parser that will split a string containing a person\'s full name into components (first, middle, last, title, suffix, ...). When I try a basic example \"J. A. Doe\" in ANTLRWorks, it[详细]
2023-04-02 17:11 分类:问答Scanner (Lexing keywords with ANTLR)
I have been working on writing a scanner for my program开发者_C百科 and most of the tutorials online include a parser along with the scanner. It doesn\'t seem possible to write a lexer without writing[详细]
2023-04-02 14:35 分类:问答ANTLR - check semantics/meaning of the values
I have a simple grammar which allows the user to define some objects with attributes. For example: carpark : my carpark[详细]
2023-04-02 11:29 分类:问答ANTLR - allow any char between to keywords
I\'d like to define a grammar for a simple language. The language allows some sort of assignments. Example[详细]
2023-04-02 06:05 分类:问答Tree of variable definitions with and without initializations
my language to parse contains statements like public var a, b = 42, c; I.e. the .g file looks something like:[详细]
2023-04-01 10:10 分类:问答Get active Antlr rule
Is it possible to get the \"active\" ANTLR rule from which a action method was called? Something like this log-function in Antlr-Pseudo-Code which should show the start and end position of some rules[详细]
2023-03-31 15:09 分类:问答