Importing a library for use in actions #4178
-
I'm working on a Clojure codebase that's parsing Clojure code using an antlr4 grammar. The output of antlr rules is strings. I'd like to convert some of these at parse time to Clojure datatypes, symbols and keywords specifically. According to the documentation: "Actions are blocks of text written in the target language and enclosed in curly braces." Is it possible to compile the grammar with references to outside libraries and then call functions within those libraries in my grammar's actions? I want to write Might be related to my other question in #4177, now that I've written it out. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
You can use lexer:header and parser:header sections to achieve that |
Beta Was this translation helpful? Give feedback.
You can use lexer:header and parser:header sections to achieve that