Lines Matching defs:TorqueGrammar
819 struct TorqueGrammar : Grammar { struct
820 static bool MatchWhitespace(InputPosition* pos) { in MatchWhitespace()
832 static bool MatchIdentifier(InputPosition* pos) { in MatchIdentifier()
839 static bool MatchStringLiteral(InputPosition* pos) { in MatchStringLiteral()
865 static bool MatchHexLiteral(InputPosition* pos) { in MatchHexLiteral()
877 static bool MatchDecimalLiteral(InputPosition* pos) { in MatchDecimalLiteral()
897 TorqueGrammar() : Grammar(&file) { SetWhitespace(MatchWhitespace); } in TorqueGrammar() argument
900 Symbol identifier = {Rule({Pattern(MatchIdentifier)}, YieldMatchedInput)};
903 Symbol stringLiteral = {
907 Symbol externalString = {Rule({&stringLiteral}, StringLiteralUnquoteAction)};
910 Symbol decimalLiteral = {
915 Symbol* typeList = List<TypeExpression*>(&type, Token(","));
918 Symbol simpleType = {
926 Symbol type = {Rule({&simpleType}), Rule({&type, Token("|"), &simpleType},
930 Symbol genericParameters = {
937 Symbol genericSpecializationTypeList = {
941 Symbol* optionalGenericParameters = Optional<TypeList>(&genericParameters);
944 Symbol typeListMaybeVarArgs = {
952 Symbol labelParameter = {Rule(
958 Symbol optionalReturnType = {Rule({Token(":"), &type}),
962 Symbol* optionalLabelList{TryOrDefault<LabelAndTypesVector>(
967 Symbol* optionalOtherwise{TryOrDefault<std::vector<std::string>>(
972 Symbol nameAndType = {
976 Symbol parameterListNoVararg = {
982 Symbol parameterListAllowVararg = {
990 Symbol* OneOf(std::vector<std::string> alternatives) { in OneOf()
999 Symbol* BinaryOperator(Symbol* nextLevel, Symbol* op) { in BinaryOperator()
1007 Symbol* expression = &assignmentExpression;
1010 Symbol incrementDecrementOperator = {
1019 Symbol locationExpression = {
1029 Symbol argumentList = {Rule(
1033 Symbol callExpression = {
1039 Symbol primaryExpression = {
1051 Symbol unaryExpression = {
1060 Symbol* multiplicativeExpression =
1064 Symbol* additiveExpression =
1068 Symbol* shiftExpression =
1074 Symbol relationalExpression = {
1080 Symbol* equalityExpression =
1084 Symbol* bitwiseExpression =
1088 Symbol logicalAndExpression = {
1094 Symbol logicalOrExpression = {
1100 Symbol conditionalExpression = {
1107 Symbol assignmentOperator = {
1114 Symbol assignmentExpression = {
1120 Symbol block = {Rule({CheckIf(Token("deferred")), Token("{"),
1125 Symbol labelBlock = {
1131 Symbol expressionWithSource = {Rule({expression}, MakeExpressionWithSource)};
1134 Symbol rangeSpecifier = {
1140 Symbol varDeclaration = {
1145 Symbol varDeclarationWithInitialization = {
1152 Symbol atomarStatement = {
1166 Symbol statement = {
1200 Symbol typeswitchCase = {
1207 Symbol optionalBody = {
1212 Symbol declaration = {
1265 Symbol moduleDeclaration = {
1270 Symbol file = {Rule({&file, &moduleDeclaration}, AddGlobalDeclaration),