
Grammar connected by Vadim Zaytsev, see the Grammar Zoo entry for details: dart/latex/v06.0/connected
Source used for this grammar: The Dart Team, Dart Programming Language Specification, Draft Version 0.70, dartLangSpec.tex, 2013-10-11T20:56:55Z [Explore]
variableDeclaration, declaredIdentifier, finalConstVarOrType, varOrType, initializedVariableDeclaration, initializedIdentifier, initializedIdentifierList, functionSignature, returnType, functionBody, block, formalParameterList, normalFormalParameters, optionalFormalParameters, optionalPositionalFormalParameters, namedFormalParameters, normalFormalParameter, simpleFormalParameter, fieldFormalParameter, defaultFormalParameter, defaultNamedParameter, classDefinition, mixins, classMemberDefinition, methodSignature, declaration, staticFinalDeclarationList, staticFinalDeclaration, operatorSignature, operator, binaryOperator, getterSignature, setterSignature, constructorSignature, redirection, initializers, superCallOrFieldInitializer, fieldInitializer, factoryConstructorSignature, redirectingFactoryConstructorSignature, constantConstructorSignature, superclass, interfaces, mixinApplicationClass, mixinApplication, typeParameter, typeParameters, metadata, expression, expressionWithoutCascade, expressionList, primary, literal, nullLiteral, numericLiteral, NUMBER, EXPONENT, HEX_NUMBER, HEX_DIGIT, booleanLiteral, stringLiteral, singleLineString, multilineString, ESCAPE_SEQUENCE, HEX_DIGIT_SEQUENCE, stringContentDQ, stringContentSQ, stringContentTDQ, stringContentTSQ, NEWLINE, stringInterpolation, symbolLiteral, listLiteral, mapLiteral, mapLiteralEntry, throwExpression, throwExpressionWithoutCascade, functionExpression, functionExpressionBody, thisExpression, newExpression, constObjectExpression, arguments, argumentList, namedArgument, cascadeSection, cascadeSelector, assignmentOperator, compoundAssignmentOperator, conditionalExpression, logicalOrExpression, logicalAndExpression, equalityExpression, equalityOperator, relationalExpression, relationalOperator, bitwiseOrExpression, bitwiseXorExpression, bitwiseAndExpression, bitwiseOperator, shiftExpression, shiftOperator, additiveExpression, additiveOperator, multiplicativeExpression, multiplicativeOperator, unaryExpression, prefixOperator, unaryOperator, postfixExpression, postfixOperator, selector, incrementOperator, assignableExpression, assignableSelector, identifier, IDENTIFIER_NO_DOLLAR, IDENTIFIER, BUILT_IN_IDENTIFIER, IDENTIFIER_START, IDENTIFIER_START_NO_DOLLAR, IDENTIFIER_PART_NO_DOLLAR, IDENTIFIER_PART, qualified, typeTest, isOperator, typeCast, asOperator, statements, statement, nonLabelledStatement, expressionStatement, localVariableDeclaration, localFunctionDeclaration, ifStatement, forStatement, forLoopParts, forInitializerStatement, whileStatement, doStatement, switchStatement, switchCase, defaultCase, rethrowStatement, tryStatement, onPart, catchPart, finallyPart, returnStatement, label, breakStatement, continueStatement, assertStatement, topLevelDefinition, getOrSet, libraryDefinition, scriptTag, libraryName, importOrExport, libraryImport, combinator, identifierList, libraryExport, partDirective, partHeader, partDeclaration, uri, type, typeName, typeArguments, typeList, typeAlias, typeAliasBody, functionTypeAlias, functionPrefix, LETTER, DIGIT, WHITESPACE, SINGLE_LINE_COMMENT, MULTI_LINE_COMMENT, compilationUnit), 1 root (compilationUnit), 4 top (ESCAPE_SEQUENCE, BUILT_IN_IDENTIFIER, WHITESPACE, SINGLE_LINE_COMMENT), 1 bottom (EOF).variableDeclaration ::= declaredIdentifier "," identifier
declaredIdentifier ::= metadata finalConstVarOrType identifier
finalConstVarOrType ::= "final" type "const" type varOrType
varOrType ::=
"var"
typeinitializedVariableDeclaration ::= declaredIdentifier "=" expression "," initializedIdentifier
initializedIdentifier ::= identifier "=" expression
initializedIdentifierList ::= initializedIdentifier "," initializedIdentifier
functionSignature ::=
metadata returnType identifier formalParameterListreturnType ::=
"void"
typefunctionBody ::= "=>" expression ";" block
block ::= "{" statements "}"
formalParameterList ::= "(" ")" "(" normalFormalParameters "," optionalFormalParameters ")" "(" optionalFormalParameters ")"
normalFormalParameters ::= normalFormalParameter "," normalFormalParameter
optionalFormalParameters ::= optionalPositionalFormalParameters namedFormalParameters
optionalPositionalFormalParameters ::= "[" defaultFormalParameter "," defaultFormalParameter "]"
namedFormalParameters ::= "{" defaultNamedParameter "," defaultNamedParameter "}"
normalFormalParameter ::= functionSignature fieldFormalParameter simpleFormalParameter
simpleFormalParameter ::= declaredIdentifier metadata identifier
fieldFormalParameter ::= metadata finalConstVarOrType "this" "." identifier formalParameterList
defaultFormalParameter ::= normalFormalParameter "=" expression
defaultNamedParameter ::= normalFormalParameter ":" expression
classDefinition ::= metadata "abstract" "class" identifier typeParameters superclass mixins interfaces "{" metadata classMemberDefinition "}" metadata "abstract" "class" mixinApplicationClass
mixins ::=
"with" typeListclassMemberDefinition ::=
declaration ";"
methodSignature functionBodymethodSignature ::= constructorSignature initializers factoryConstructorSignature "static" functionSignature "static" getterSignature "static" setterSignature operatorSignature
methodSignature ::= redirectingFactoryConstructorSignature
declaration ::= constantConstructorSignature redirectioninitializers constructorSignature redirectioninitializers "external" constantConstructorSignature "external" constructorSignature "external" "static" getterSignature "external" "static" setterSignature "external" operatorSignature "external" "static" functionSignature "static" "final""const" type staticFinalDeclarationList "const" type staticFinalDeclarationList "final" type initializedIdentifierList "static" "var"type initializedIdentifierList
staticFinalDeclarationList ::= staticFinalDeclaration "," staticFinalDeclaration
staticFinalDeclaration ::=
identifier "=" expressionoperatorSignature ::= returnType "operator" operator formalParameterList
operator ::= "~" binaryOperator "[" "]" "[" "]" "="
binaryOperator ::=
multiplicativeOperator
additiveOperator
shiftOperator
relationalOperator
"=="
bitwiseOperatorgetterSignature ::= type "get" identifier
setterSignature ::= returnType "set" identifier formalParameterList
constructorSignature ::= identifier "." identifier formalParameterList
redirection ::= ":" "this" "." identifier arguments
initializers ::= ":" superCallOrFieldInitializer "," superCallOrFieldInitializer
superCallOrFieldInitializer ::= "super" arguments "super" "." identifier arguments fieldInitializer
fieldInitializer ::= "this" "." identifier "=" conditionalExpression cascadeSection
factoryConstructorSignature ::= "factory" identifier "." identifier formalParameterList
redirectingFactoryConstructorSignature ::= "const" "factory" identifier "." identifier formalParameterList "=" type "." identifier
constantConstructorSignature ::=
"const" qualified formalParameterListsuperclass ::=
"extends" typeinterfaces ::=
"implements" typeListmixinApplicationClass ::= identifier typeParameters "=" mixinApplication ";"
mixinApplication ::=
type mixins interfacestypeParameter ::= metadata identifier "extends" type
typeParameters ::= "<" typeParameter "," typeParameter ">"
metadata ::= "@" qualified "." identifier arguments
expression ::=
assignableExpression assignmentOperator expression
conditionalExpression cascadeSection
throwExpressionexpressionWithoutCascade ::= assignableExpression assignmentOperator expressionWithoutCascade conditionalExpression throwExpressionWithoutCascade
expressionList ::= expression "," expression
primary ::= thisExpression "super" assignableSelector functionExpression literal identifier newExpression constObjectExpression "(" expression ")"
literal ::= nullLiteral booleanLiteral numericLiteral stringLiteral symbolLiteral mapLiteral listLiteral
nullLiteral ::=
"null"numericLiteral ::= NUMBER HEX_NUMBER
NUMBER ::= DIGIT "." DIGIT EXPONENT "." DIGIT EXPONENT
EXPONENT ::= "e""E" "+""-" DIGIT
HEX_NUMBER ::= "0x" HEX_DIGIT "0X" HEX_DIGIT
HEX_DIGIT ::= "a" "b" "c" "d" "e" "f" "A" "B" "C" "D" "E" "F" DIGIT
booleanLiteral ::= "true" "false"
stringLiteral ::= multilineStringsingleLineString
singleLineString ::= """ stringContentDQ """ """ stringContentSQ """ "r" """ """NEWLINE """
multilineString ::= """"" stringContentTDQ """"" """"" stringContentTSQ """"" "r" """"" """"" """""
ESCAPE_SEQUENCE ::= "\n" "\r" "\f" "\b" "\t" "\v" "\x" HEX_DIGIT HEX_DIGIT "\u" HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT "\u{" HEX_DIGIT_SEQUENCE "}"
HEX_DIGIT_SEQUENCE ::= HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT
stringContentDQ ::= "\"""""$"NEWLINE "\" NEWLINE stringInterpolation
stringContentSQ ::= "\"""""$"NEWLINE "\" NEWLINE stringInterpolation
stringContentTDQ ::= "\"""""""$" stringInterpolation
stringContentTSQ ::= "\"""""""$" stringInterpolation
NEWLINE ::= "\n" "\r"
stringInterpolation ::= "$" IDENTIFIER_NO_DOLLAR "$" "{" expression "}"
symbolLiteral ::= "#" operatoridentifier "." identifier
listLiteral ::= "const" typeArguments "[" expressionList "," "]"
mapLiteral ::= "const" typeArguments "{" mapLiteralEntry "," mapLiteralEntry "," "}"
mapLiteralEntry ::=
expression ":" expressionthrowExpression ::=
"throw" expressionthrowExpressionWithoutCascade ::=
"throw" expressionWithoutCascadefunctionExpression ::= formalParameterList functionExpressionBody
functionExpressionBody ::=
"=>" expression
blockthisExpression ::=
"this"newExpression ::= "new" type "." identifier arguments
constObjectExpression ::= "const" type "." identifier arguments
arguments ::= "(" argumentList ")"
argumentList ::= namedArgument "," namedArgument expressionList "," namedArgument
namedArgument ::= label expression
cascadeSection ::= ".." cascadeSelector arguments assignableSelector arguments assignmentOperator expressionWithoutCascade
cascadeSelector ::= "[" expression "]" identifier
assignmentOperator ::=
"="
compoundAssignmentOperatorcompoundAssignmentOperator ::= "*=" "/=" "~/=" "%=" "+=" "-=" "<<=" ">>=" "&=" "^=" "|="
conditionalExpression ::= logicalOrExpression "?" expressionWithoutCascade ":" expressionWithoutCascade
logicalOrExpression ::= logicalAndExpression "||" logicalAndExpression
logicalAndExpression ::= equalityExpression "&&" equalityExpression
equalityExpression ::= relationalExpression equalityOperator relationalExpression "super" equalityOperator relationalExpression
equalityOperator ::= "==" "!="
relationalExpression ::= bitwiseOrExpression typeTesttypeCastrelationalOperator bitwiseOrExpression "super" relationalOperator bitwiseOrExpression
relationalOperator ::= ">=" ">" "<=" "<"
bitwiseOrExpression ::= bitwiseXorExpression "|" bitwiseXorExpression "super" "|" bitwiseXorExpression
bitwiseXorExpression ::= bitwiseAndExpression "^" bitwiseAndExpression "super" "^" bitwiseAndExpression
bitwiseAndExpression ::= shiftExpression "&" shiftExpression "super" "&" shiftExpression
bitwiseOperator ::= "&" "^" "|"
shiftExpression ::= additiveExpression shiftOperator additiveExpression "super" shiftOperator additiveExpression
shiftOperator ::= "<<" ">>"
additiveExpression ::= multiplicativeExpression additiveOperator multiplicativeExpression "super" additiveOperator multiplicativeExpression
additiveOperator ::= "+" "-"
multiplicativeExpression ::= unaryExpression multiplicativeOperator unaryExpression "super" multiplicativeOperator unaryExpression
multiplicativeOperator ::= "*" "/" "%" "~/"
unaryExpression ::=
prefixOperator unaryExpression
postfixExpression
prefixOperator "super"
incrementOperator assignableExpressionprefixOperator ::=
"-"
unaryOperatorunaryOperator ::= "!" "~"
postfixExpression ::=
assignableExpression postfixOperator
primary selectorpostfixOperator ::= incrementOperator
selector ::= assignableSelector arguments
incrementOperator ::= "++" "--"
assignableExpression ::= primary namedArgument assignableSelector "super" assignableSelector identifier
assignableSelector ::= "[" expression "]" "." identifier
identifier ::= IDENTIFIER
IDENTIFIER_NO_DOLLAR ::=
IDENTIFIER_START_NO_DOLLAR IDENTIFIER_PART_NO_DOLLARIDENTIFIER ::=
IDENTIFIER_START IDENTIFIER_PARTBUILT_IN_IDENTIFIER ::= "abstract" "as" "dynamic" "export" "external" "factory" "get" "implements" "import" "library" "operator" "part" "set" "static" "typedef"
IDENTIFIER_START ::=
IDENTIFIER_START_NO_DOLLAR
"$"IDENTIFIER_START_NO_DOLLAR ::=
LETTER
"_"IDENTIFIER_PART_NO_DOLLAR ::= IDENTIFIER_START_NO_DOLLAR DIGIT
IDENTIFIER_PART ::= IDENTIFIER_START DIGIT
qualified ::= identifier "." identifier
typeTest ::= isOperator type
isOperator ::= "is" "!"
typeCast ::= asOperator type
asOperator ::=
"as"statements ::=
statementstatement ::=
label nonLabelledStatementnonLabelledStatement ::= block localVariableDeclaration forStatement whileStatement doStatement switchStatement ifStatement rethrowStatement tryStatement breakStatement continueStatement returnStatement expressionStatement assertStatement localFunctionDeclaration
expressionStatement ::= expression ";"
localVariableDeclaration ::=
initializedVariableDeclaration ";"localFunctionDeclaration ::= functionSignature functionBody
ifStatement ::= "if" "(" expression ")" statement "else" statement
forStatement ::= "for" "(" forLoopParts ")" statement
forLoopParts ::= forInitializerStatement expression ";" expressionList declaredIdentifier "in" expression identifier "in" expression
forInitializerStatement ::= localVariableDeclaration ";" expression ";"
whileStatement ::= "while" "(" expression ")" statement
doStatement ::= "do" statement "while" "(" expression ")" ";"
switchStatement ::= "switch" "(" expression ")" "{" switchCase defaultCase "}"
switchCase ::= label "case" expression ":" statements
defaultCase ::= label "default" ":" statements
rethrowStatement ::=
"rethrow"tryStatement ::= "try" block onPart finallyPartfinallyPart
onPart ::= catchPart block "on" type catchPart block
catchPart ::= "catch" "(" identifier "," identifier ")"
finallyPart ::=
"finally" blockreturnStatement ::= "return" expression ";"
label ::=
identifier ":"breakStatement ::= "break" identifier ";"
continueStatement ::= "continue" identifier ";"
assertStatement ::= "assert" "(" conditionalExpression ")" ";"
topLevelDefinition ::= classDefinition typeAlias "external" functionSignature ";" "external" getterSignature ";" "external" setterSignature ";" functionSignature functionBody returnType getOrSet identifier formalParameterList functionBody "final""const" type staticFinalDeclarationList ";" variableDeclaration ";"
getOrSet ::= "get" "set"
libraryDefinition ::= scriptTag libraryName importOrExport partDirective topLevelDefinition
scriptTag ::= "#!" NEWLINE NEWLINE
libraryName ::= metadata "library" identifier "." identifier ";"
importOrExport ::= libraryImport libraryExport
libraryImport ::= metadata "import" uri "as" identifier combinator ";"
combinator ::= "show" identifierList "hide" identifierList
identifierList ::= identifier "," identifier
libraryExport ::= metadata "export" uri combinator ";"
partDirective ::= metadata "part" uri ";"
partHeader ::= metadata "part" "of" identifier "." identifier ";"
partDeclaration ::=
partHeader topLevelDefinition EOFuri ::= stringLiteral
type ::=
typeName typeArgumentstypeName ::= qualified
typeArguments ::= "<" typeList ">"
typeList ::= type "," type
typeAlias ::=
metadata "typedef" typeAliasBodytypeAliasBody ::= functionTypeAlias
functionTypeAlias ::= functionPrefix typeParameters formalParameterList ";"
functionPrefix ::=
returnType identifierLETTER ::= "a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "l" "m" "n" "o" "p" "q" "r" "s" "t" "u" "v" "w" "x" "y" "z" "A" "B" "C" "D" "E" "F" "G" "H" "I" "J" "K" "L" "M" "N" "O" "P" "Q" "R" "S" "T" "U" "V" "W" "X" "Y" "Z"
DIGIT ::= "0" "1" "2" "3" "4" "5" "6" "7" "8" "9"
WHITESPACE ::= "\t"" "NEWLINE
SINGLE_LINE_COMMENT ::= "//" NEWLINE
MULTI_LINE_COMMENT ::= "/*" MULTI_LINE_COMMENT"*/" "*/"
compilationUnit ::= libraryDefinition partDeclaration