Skip to content

Instantly share code, notes, and snippets.

@cubuspl42
Created February 4, 2022 10:04
Show Gist options
  • Save cubuspl42/2a1da94b54847c3a9bf9f10752b37a5e to your computer and use it in GitHub Desktop.
Save cubuspl42/2a1da94b54847c3a9bf9f10752b37a5e to your computer and use it in GitHub Desktop.
parser grammar BiaParser;
options { tokenVocab = BiaLexer; }
typeExpression
: referredName=Identifier # typeReference ;
expression
: callableExpression # callableExpression_
| left=expression operator=Lt right=expression # binaryOperation
| left=expression operator=Gt right=expression # binaryOperation ;
callableExpression
: LeftParen expression RightParen # parenExpression
| callee=callableExpression callTypeVariableList? LeftParen callArgumentList RightParen # callExpression
| referredName=Identifier # reference ;
callTypeVariableList: Lt typeExpression (Comma typeExpression)* Gt ;
callArgumentList: (expression (Comma expression)*)? ;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment