All Downloads are FREE. Search and download functionalities are using the official Maven repository.

kkaone.jar-invoke.6.5.4-0.source-code.JarInvoke.g4 Maven / Gradle / Ivy

There is a newer version: 6.5.4-1
Show newest version
grammar JarInvoke;

@header {
package com.github.pukkaone.jarinvoke.parser;
}

ASSIGN: '=';
COMMA: ',';
DOT: '.';
PAREN_OPEN: '(';
PAREN_CLOSE: ')';

STRING_LITERAL
  : '\'' ~('\'')*? '\''
  | '"' ~('"')*? '"'
  ;

WHITESPACE
  : [\f\n\r\t ]+ -> skip
  ;

INVOKE: 'invoke';
LOAD: 'load';

IDENTIFIER
	:	Letter LetterOrDigit*
	;

fragment Letter
	:	[A-Za-z$_]
	;

fragment LetterOrDigit
	:	[0-9A-Za-z$_]
	;

translationUnit
  : statement* EOF
  ;

statement
  : invokeExpression
  | loadStatement
  | requireStatement
  ;

invokeExpression
  : IDENTIFIER '.' 'invoke' '(' STRING_LITERAL ',' STRING_LITERAL ')'
  ;

loadStatement
  : IDENTIFIER '=' 'load' '(' STRING_LITERAL ',' STRING_LITERAL ')'
  ;

requireStatement
  : IDENTIFIER '=' 'require' '(' STRING_LITERAL ',' STRING_LITERAL ')'
  ;




© 2015 - 2025 Weber Informatics LLC | Privacy Policy