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

imports.TypeDefParser.g4 Maven / Gradle / Ivy

There is a newer version: 3.130.78
Show newest version
parser grammar TypeDefParser;
options { tokenVocab = HdesLexer; }
import ExpressionParser;

scalarType: ScalarType;

headers: '(' headersAccepts ')' ':' headersReturns;
headersAccepts: typeDefs;
headersReturns: typeDefs;

typeDefs: '{' (typeDef ( (',')? typeDef)*)? '}';
typeDef: typeDefNames ':' (arrayType | objectType | simpleType);
typeDefNames: typeDefName (',' typeDefName)*;
typeDefName: simpleTypeName optional?;

simpleType: scalarType (debugValue? | (formula | formulaOverAll)?);
objectType: typeDefs;
arrayType: (simpleType | objectType) '[' ']';

optional: '?';
debugValue: 'debug-value' '=' literal;
formula: '=' expressionUnit;
formulaOverAll: '=' '*' expressionUnit; // apply formula over array of elements


mapping: '{' (mappingArg (',' mappingArg)* )? '}';  
mappingArg: fieldMapping | fastMapping;
fieldMapping: simpleTypeName ':' mappingValue;
fastMapping: typeName;

mappingArray: '[' (mapping (',' mapping)*)? ']';
mappingValue: mapping | mappingArray | expressionUnit;




© 2015 - 2025 Weber Informatics LLC | Privacy Policy