Browsable Rascal Grammar

CC-BY

Grammar extracted by Vadim Zaytsev, see the Grammar Zoo entry for details: §wip/metasyntax/rascal-types/extracted
Source used for this grammar: Mark Hills, Jurgen J. Vinju, lang::rascal::types::*, 2009–2013

Summary

Syntax

TagKind ::=
	[functionKind]::ε
	[variableKind]::ε
	[allKind]::ε
	[annoKind]::ε
	[dataKind]::ε
	[viewKind]::ε
	[aliasKind]::ε
	[moduleKind]::ε
	[tagKind]::ε
RName ::=
	[RSimpleName]::[name]::string
	[RCompoundName]::[nameParts]::string*
Symbol ::=
	[user]::([rname]::RName [parameters]::Symbol*)
	[failure]::[messages]::Message*
	[inferred]::[uniqueId]::integer
	[overloaded]::[overloads]::Symbol*
LabelSource ::=
	[visitLabel]::ε
	[blockLabel]::ε
	[forLabel]::ε
	[whileLabel]::ε
	[doWhileLabel]::ε
	[ifLabel]::ε
	[switchLabel]::ε
	[caseLabel]::ε
Modifier ::=
	[javaModifier]::ε
	[testModifier]::ε
	[defaultModifier]::ε
Vis ::=
	[publicVis]::ε
	[privateVis]::ε
	[defaultVis]::ε
AbstractValue ::=
	[label]::([name]::RName [source]::LabelSource [containedIn]::integer [at]::string)
	[variable]::([name]::RName [rtype]::Symbol [inferred]::("true" | "false") [containedIn]::integer [at]::string)
	[function]::([name]::RName [rtype]::Symbol [isVarArgs]::("true" | "false") [containedIn]::integer [throwsTypes]::Symbol* [at]::string)
	[closure]::([rtype]::Symbol [containedIn]::integer [at]::string)
	[module]::([name]::RName [at]::string)
	[overload]::([items]::integer* [rtype]::Symbol)
	[datatype]::([name]::RName [rtype]::Symbol [containedIn]::integer [ats]::string*)
	[sorttype]::([name]::RName [rtype]::Symbol [containedIn]::integer [ats]::string*)
	[constructor]::([name]::RName [rtype]::Symbol [containedIn]::integer [at]::string)
	[production]::([name]::RName [rtype]::Symbol [containedIn]::integer [at]::string)
	[annotation]::([name]::RName [rtype]::Symbol [onTypes]::Symbol* [containedIn]::integer [at]::string)
	[tag]::([name]::RName [tkind]::TagKind [onTypes]::Symbol* [containedIn]::integer [at]::string)
	[alias]::([name]::RName [rtype]::Symbol [containedIn]::integer [at]::string)
	[booleanScope]::([containedIn]::integer [at]::string)
	[blockScope]::([containedIn]::integer [at]::string)
LabelStackItem ::=
	[labelStackItem]::([labelName]::RName [labelSource]::LabelSource [labelType]::Symbol)
Timing ::=
	[timing]::([tmsg]::string [tstart]::string [tend]::string)
Configuration ::=
	[config]::([messages]::Message* [locationTypes]::(string Symbol)* [labelEnv]::(RName integer)* [fcvEnv]::(RName integer)* [typeEnv]::(RName integer)* [modEnv]::(RName integer)* [annotationEnv]::(RName integer)* [tagEnv]::(RName integer)* [visibilities]::(integer Vis)* [store]::(integer AbstractValue)* [adtFields]::(integer string Symbol)* [nonterminalFields]::(integer string Symbol)* [functionModifiers]::(integer Modifier)* [definitions]::(integer string)* [uses]::(integer string)* [adtConstructors]::(integer integer)* [nonterminalConstructors]::(integer integer)* [stack]::integer* [labelStack]::LabelStackItem* [timings]::Timing* [nextLoc]::integer [uniqueify]::integer)
DefOrUse ::=
	[def]::[name]::RName
	[use]::[name]::RName
LiteralNodeInfo ::=
	[literalNodeInfo]::(DefOrUse string)
MapNodeInfo ::=
	[mapNodeInfo]::(PatternTree PatternTree)
PatternTree ::=
	[setNode]::[children]::PatternTree*
	[listNode]::[children]::PatternTree*
	[nameNode]::[name]::RName
	[multiNameNode]::[name]::RName
	[spliceNodePlus]::[name]::RName
	[spliceNodePlus]::([name]::RName [at]::string [rtype]::Symbol)
	[spliceNodeStar]::[name]::RName
	[spliceNodeStar]::([name]::RName [at]::string [rtype]::Symbol)
	[negativeNode]::[child]::PatternTree
	[literalNode]::[rtype]::Symbol
	[literalNode]::[names]::LiteralNodeInfo*
	[tupleNode]::[children]::PatternTree*
	[typedNameNode]::([name]::RName [at]::string [rtype]::Symbol)
	[mapNode]::[mapChildren]::MapNodeInfo*
	[reifiedTypeNode]::([s]::PatternTree [d]::PatternTree)
	[callOrTreeNode]::([head]::PatternTree [args]::PatternTree*)
	[concreteSyntaxNode]::([rtype]::Symbol [args]::PatternTree*)
	[varBecomesNode]::([name]::RName [at]::string [child]::PatternTree)
	[asTypeNode]::([rtype]::Symbol [child]::PatternTree)
	[deepNode]::[child]::PatternTree
	[antiNode]::[child]::PatternTree
	[tvarBecomesNode]::([rtype]::Symbol [name]::RName [at]::string [child]::PatternTree)
BindResult ::=
	Configuration PatternTree
AssignableTree ::=
	[bracketNode]::[child]::AssignableTree
	[variableNode]::[name]::RName
	[subscriptNode]::([receiver]::AssignableTree [subscriptType]::Symbol)
	[fieldAccessNode]::([receiver]::AssignableTree [name]::RName)
	[ifDefinedOrDefaultNode]::([receiver]::AssignableTree [defaultType]::Symbol)
	[constructorNode]::([name]::RName [children]::AssignableTree*)
	[tupleNodeAT]::[children]::AssignableTree*
	[annotationNode]::([receiver]::AssignableTree [name]::RName)
ATResult ::=
	Configuration AssignableTree
RuntimeException ::=
	[UnexpectedRType]::[t1]::Symbol
	[UnexpectedRTypes]::([t1]::Symbol [t2]::Symbol)
	[UnimplementedRType]::[t1]::Symbol
	[CannotCalculateBindings]::([t1]::Symbol [t2]::Symbol [l]::string)
	[invalidMatch]::([varName]::string [typeLub]::Symbol [typeBound]::Symbol)
	[invalidMatch]::([targetType]::Symbol [sourceType]::Symbol)
Bindings ::=
	([varName]::string [varType]::Symbol)*
RSignatureItem ::=
	[AliasSigItem]::([aliasName]::RName [aliasType]::UserType [aliasedType]::Type [at]::string)
	[FunctionSigItem]::([functionName]::RName [sig]::Signature [at]::string)
	[VariableSigItem]::([variableName]::RName [variableType]::Type [at]::string)
	[ADTSigItem]::([adtName]::RName [adtType]::UserType [at]::string)
	[ConstructorSigItem]::([conName]::RName [adtType]::UserType [argTypes]::TypeArg* [adtAt]::string [at]::string)
	[ProductionSigItem]::([prod]::Production [sortAt]::string [at]::string)
	[AnnotationSigItem]::([annName]::RName [annType]::Type [onType]::Type [at]::string)
	[TagSigItem]::([tagName]::RName [tagKind]::TagKind [taggedTypes]::Symbol* [at]::string)
	[LexicalSigItem]::([sortName]::RName [sort]::Symbol [at]::string)
	[ContextfreeSigItem]::([sortName]::RName [sort]::Symbol [at]::string)
	[KeywordSigItem]::([sortName]::RName [sort]::Symbol [at]::string)
	[LayoutSigItem]::([sortName]::RName [sort]::Symbol [at]::string)
RSignature ::=
	[rsignature]::([datatypes]::RSignatureItem* [lexicalNonterminals]::RSignatureItem* [contextfreeNonterminals]::RSignatureItem* [keywordNonterminals]::RSignatureItem* [layoutNonterminals]::RSignatureItem* [aliases]::RSignatureItem* [tags]::RSignatureItem* [annotations]::RSignatureItem* [publicVariables]::RSignatureItem* [publicFunctions]::RSignatureItem* [publicConstructors]::RSignatureItem* [publicProductions]::RSignatureItem* [privateVariables]::RSignatureItem* [privateFunctions]::RSignatureItem* [imports]::RName*)

GrammarLabMaintained by Dr. Vadim Zaytsev a.k.a. @grammarware. Last updated in September 2015. []