Created
July 8, 2016 09:07
-
-
Save pmiddend/8a2fa27f0a8ab1c5a1123d0a1752557d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lexer grammar TemplatesLexer; | |
EXPANSION_BEGIN : '${' ; | |
DOLLAR : '$' ; | |
BRACE_OPEN : '{' ; | |
BRACE_CLOSE : '}' ; | |
PREFIX_REPLACE : '#' ; | |
REST : ~[$\{\}#] ; | |
parser grammar TemplatesParser; | |
options { tokenVocab=TemplatesLexer; } | |
expr : (braceExpansion | REST)* ; | |
//normalText : REST ; | |
braceExpansion : EXPANSION_BEGIN insideBraces BRACE_CLOSE ; | |
insideBraces : REST+ operator? ; | |
operator : PREFIX_REPLACE REST+ ; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment