From a5896921e5b9ff9dad488e3bc124863d43da430c Mon Sep 17 00:00:00 2001 From: Robert burner Schadek Date: Tue, 19 Nov 2024 13:45:38 +0100 Subject: [PATCH] master should compile again --- Makefile | 2 +- source/graphql/argumentextractor.d | 2 - source/graphql/argumentextractortests.d | 2 - source/graphql/ast.d | 2938 +++++++++++++---------- source/graphql/astselector.d | 2 - source/graphql/builder.d | 2 - source/graphql/directives.d | 2 - source/graphql/graphql.d | 2 - source/graphql/helper.d | 2 - source/graphql/parser.d | 2005 +++++++++------- source/graphql/starwars/introspection.d | 2 - source/graphql/starwars/query.d | 2 - source/graphql/starwars/validation.d | 2 - source/graphql/treevisitor.d | 2 - source/graphql/validation/querybased.d | 2 - source/graphql/validation/schemabased.d | 2 - source/graphql/visitor.d | 1629 +++++++------ 17 files changed, 3608 insertions(+), 2992 deletions(-) diff --git a/Makefile b/Makefile index 310692c8..cd262329 100644 --- a/Makefile +++ b/Makefile @@ -22,7 +22,7 @@ handWrittenFiles=source/graphql/argumentextractor.d \ source/graphql/directives.d gen: - ../Darser/darser --dod -i graphql.yaml \ + ../Darser/darser -i graphql.yaml \ -a source/graphql/ast.d -b "graphql" \ -p source/graphql/parser.d -q "graphql" \ -e source/graphql/exception.d -g "graphql" \ diff --git a/source/graphql/argumentextractor.d b/source/graphql/argumentextractor.d index 77de5a84..4b40cf50 100644 --- a/source/graphql/argumentextractor.d +++ b/source/graphql/argumentextractor.d @@ -1,7 +1,5 @@ module graphql.argumentextractor; -__EOF__ - import std.array : back, empty, popBack; import std.conv : to; import std.format : format; diff --git a/source/graphql/argumentextractortests.d b/source/graphql/argumentextractortests.d index 214f9f91..82d9e22e 100644 --- a/source/graphql/argumentextractortests.d +++ b/source/graphql/argumentextractortests.d @@ -1,7 +1,5 @@ module graphql.argumentextractortests; -__EOF__ - import std.format : format; import vibe.data.json; diff --git a/source/graphql/ast.d b/source/graphql/ast.d index c69e8141..50033f09 100644 --- a/source/graphql/ast.d +++ b/source/graphql/ast.d @@ -6,95 +6,127 @@ import graphql.visitor; @safe : -enum DocumentEnum : ubyte { +class Node {} + +enum DocumentEnum { Defi, } -struct Document { +class Document : Node { @safe : - uint defsIdx; - DocumentEnum ruleSelection; + Definitions defs; + + this(DocumentEnum ruleSelection, Definitions defs) { + this.ruleSelection = ruleSelection; + this.defs = defs; + } + + void visit(Visitor vis) { + vis.accept(this); + } + + void visit(Visitor vis) const { + vis.accept(this); + } - static Document ConstructDefi(uint defs) { - Document ret; - ret.ruleSelection = DocumentEnum.Defi; - ret.defsIdx = defs; - return ret; + void visit(ConstVisitor vis) { + vis.accept(this); } + void visit(ConstVisitor vis) const { + vis.accept(this); + } } -enum DefinitionsEnum : ubyte { +enum DefinitionsEnum { Def, Defs, } -struct Definitions { +class Definitions : Node { @safe : - uint defIdx; - uint followIdx; - DefinitionsEnum ruleSelection; + Definition def; + Definitions follow; + + this(DefinitionsEnum ruleSelection, Definition def) { + this.ruleSelection = ruleSelection; + this.def = def; + } - static Definitions ConstructDef(uint def) { - Definitions ret; - ret.ruleSelection = DefinitionsEnum.Def; - ret.defIdx = def; - return ret; + this(DefinitionsEnum ruleSelection, Definition def, Definitions follow) { + this.ruleSelection = ruleSelection; + this.def = def; + this.follow = follow; } - static Definitions ConstructDefs(uint def, uint follow) { - Definitions ret; - ret.ruleSelection = DefinitionsEnum.Defs; - ret.defIdx = def; - ret.followIdx = follow; - return ret; + void visit(Visitor vis) { + vis.accept(this); } + void visit(Visitor vis) const { + vis.accept(this); + } + + void visit(ConstVisitor vis) { + vis.accept(this); + } + + void visit(ConstVisitor vis) const { + vis.accept(this); + } } -enum DefinitionEnum : ubyte { +enum DefinitionEnum { O, F, T, } -struct Definition { +class Definition : Node { @safe : - uint fragIdx; - uint typeIdx; - uint opIdx; - DefinitionEnum ruleSelection; + FragmentDefinition frag; + TypeSystemDefinition type; + OperationDefinition op; + + this(DefinitionEnum ruleSelection, OperationDefinition op) { + this.ruleSelection = ruleSelection; + this.op = op; + } + + this(DefinitionEnum ruleSelection, FragmentDefinition frag) { + this.ruleSelection = ruleSelection; + this.frag = frag; + } - static Definition ConstructO(uint op) { - Definition ret; - ret.ruleSelection = DefinitionEnum.O; - ret.opIdx = op; - return ret; + this(DefinitionEnum ruleSelection, TypeSystemDefinition type) { + this.ruleSelection = ruleSelection; + this.type = type; } - static Definition ConstructF(uint frag) { - Definition ret; - ret.ruleSelection = DefinitionEnum.F; - ret.fragIdx = frag; - return ret; + void visit(Visitor vis) { + vis.accept(this); } - static Definition ConstructT(uint type) { - Definition ret; - ret.ruleSelection = DefinitionEnum.T; - ret.typeIdx = type; - return ret; + void visit(Visitor vis) const { + vis.accept(this); } + void visit(ConstVisitor vis) { + vis.accept(this); + } + + void visit(ConstVisitor vis) const { + vis.accept(this); + } } -enum OperationDefinitionEnum : ubyte { +enum OperationDefinitionEnum { SelSet, OT_N_VD, OT_N_V, @@ -106,316 +138,348 @@ enum OperationDefinitionEnum : ubyte { OT, } -struct OperationDefinition { +class OperationDefinition : Node { @safe : - uint vdIdx; - uint otIdx; - uint dIdx; - uint ssIdx; + OperationDefinitionEnum ruleSelection; + VariableDefinitions vd; + OperationType ot; + Directives d; + SelectionSet ss; Token name; - OperationDefinitionEnum ruleSelection; + this(OperationDefinitionEnum ruleSelection, SelectionSet ss) { + this.ruleSelection = ruleSelection; + this.ss = ss; + } - static OperationDefinition ConstructSelSet(uint ss) { - OperationDefinition ret; - ret.ruleSelection = OperationDefinitionEnum.SelSet; - ret.ssIdx = ss; - return ret; + this(OperationDefinitionEnum ruleSelection, OperationType ot, Token name, VariableDefinitions vd, Directives d, SelectionSet ss) { + this.ruleSelection = ruleSelection; + this.ot = ot; + this.name = name; + this.vd = vd; + this.d = d; + this.ss = ss; } - static OperationDefinition ConstructOT_N_VD(uint ot, Token name, uint vd, uint d, uint ss) { - OperationDefinition ret; - ret.ruleSelection = OperationDefinitionEnum.OT_N_VD; - ret.otIdx = ot; - ret.name = name; - ret.vdIdx = vd; - ret.dIdx = d; - ret.ssIdx = ss; - return ret; + this(OperationDefinitionEnum ruleSelection, OperationType ot, Token name, VariableDefinitions vd, SelectionSet ss) { + this.ruleSelection = ruleSelection; + this.ot = ot; + this.name = name; + this.vd = vd; + this.ss = ss; } - static OperationDefinition ConstructOT_N_V(uint ot, Token name, uint vd, uint ss) { - OperationDefinition ret; - ret.ruleSelection = OperationDefinitionEnum.OT_N_V; - ret.otIdx = ot; - ret.name = name; - ret.vdIdx = vd; - ret.ssIdx = ss; - return ret; + this(OperationDefinitionEnum ruleSelection, OperationType ot, Token name, Directives d, SelectionSet ss) { + this.ruleSelection = ruleSelection; + this.ot = ot; + this.name = name; + this.d = d; + this.ss = ss; } - static OperationDefinition ConstructOT_N_D(uint ot, Token name, uint d, uint ss) { - OperationDefinition ret; - ret.ruleSelection = OperationDefinitionEnum.OT_N_D; - ret.otIdx = ot; - ret.name = name; - ret.dIdx = d; - ret.ssIdx = ss; - return ret; + this(OperationDefinitionEnum ruleSelection, OperationType ot, Token name, SelectionSet ss) { + this.ruleSelection = ruleSelection; + this.ot = ot; + this.name = name; + this.ss = ss; } - static OperationDefinition ConstructOT_N(uint ot, Token name, uint ss) { - OperationDefinition ret; - ret.ruleSelection = OperationDefinitionEnum.OT_N; - ret.otIdx = ot; - ret.name = name; - ret.ssIdx = ss; - return ret; + this(OperationDefinitionEnum ruleSelection, OperationType ot, VariableDefinitions vd, Directives d, SelectionSet ss) { + this.ruleSelection = ruleSelection; + this.ot = ot; + this.vd = vd; + this.d = d; + this.ss = ss; } - static OperationDefinition ConstructOT_VD(uint ot, uint vd, uint d, uint ss) { - OperationDefinition ret; - ret.ruleSelection = OperationDefinitionEnum.OT_VD; - ret.otIdx = ot; - ret.vdIdx = vd; - ret.dIdx = d; - ret.ssIdx = ss; - return ret; + this(OperationDefinitionEnum ruleSelection, OperationType ot, VariableDefinitions vd, SelectionSet ss) { + this.ruleSelection = ruleSelection; + this.ot = ot; + this.vd = vd; + this.ss = ss; } - static OperationDefinition ConstructOT_V(uint ot, uint vd, uint ss) { - OperationDefinition ret; - ret.ruleSelection = OperationDefinitionEnum.OT_V; - ret.otIdx = ot; - ret.vdIdx = vd; - ret.ssIdx = ss; - return ret; + this(OperationDefinitionEnum ruleSelection, OperationType ot, Directives d, SelectionSet ss) { + this.ruleSelection = ruleSelection; + this.ot = ot; + this.d = d; + this.ss = ss; } - static OperationDefinition ConstructOT_D(uint ot, uint d, uint ss) { - OperationDefinition ret; - ret.ruleSelection = OperationDefinitionEnum.OT_D; - ret.otIdx = ot; - ret.dIdx = d; - ret.ssIdx = ss; - return ret; + this(OperationDefinitionEnum ruleSelection, OperationType ot, SelectionSet ss) { + this.ruleSelection = ruleSelection; + this.ot = ot; + this.ss = ss; } - static OperationDefinition ConstructOT(uint ot, uint ss) { - OperationDefinition ret; - ret.ruleSelection = OperationDefinitionEnum.OT; - ret.otIdx = ot; - ret.ssIdx = ss; - return ret; + void visit(Visitor vis) { + vis.accept(this); } + void visit(Visitor vis) const { + vis.accept(this); + } + + void visit(ConstVisitor vis) { + vis.accept(this); + } + + void visit(ConstVisitor vis) const { + vis.accept(this); + } } -enum SelectionSetEnum : ubyte { +enum SelectionSetEnum { SS, } -struct SelectionSet { +class SelectionSet : Node { @safe : - uint selIdx; - SelectionSetEnum ruleSelection; + Selections sel; + + this(SelectionSetEnum ruleSelection, Selections sel) { + this.ruleSelection = ruleSelection; + this.sel = sel; + } - static SelectionSet ConstructSS(uint sel) { - SelectionSet ret; - ret.ruleSelection = SelectionSetEnum.SS; - ret.selIdx = sel; - return ret; + void visit(Visitor vis) { + vis.accept(this); } + void visit(Visitor vis) const { + vis.accept(this); + } + + void visit(ConstVisitor vis) { + vis.accept(this); + } + + void visit(ConstVisitor vis) const { + vis.accept(this); + } } -enum OperationTypeEnum : ubyte { +enum OperationTypeEnum { Query, Mutation, Sub, } -struct OperationType { +class OperationType : Node { @safe : + OperationTypeEnum ruleSelection; Token tok; - OperationTypeEnum ruleSelection; + this(OperationTypeEnum ruleSelection, Token tok) { + this.ruleSelection = ruleSelection; + this.tok = tok; + } - static OperationType ConstructQuery(Token tok) { - OperationType ret; - ret.ruleSelection = OperationTypeEnum.Query; - ret.tok = tok; - return ret; + void visit(Visitor vis) { + vis.accept(this); } - static OperationType ConstructMutation(Token tok) { - OperationType ret; - ret.ruleSelection = OperationTypeEnum.Mutation; - ret.tok = tok; - return ret; + void visit(Visitor vis) const { + vis.accept(this); } - static OperationType ConstructSub(Token tok) { - OperationType ret; - ret.ruleSelection = OperationTypeEnum.Sub; - ret.tok = tok; - return ret; + void visit(ConstVisitor vis) { + vis.accept(this); } + void visit(ConstVisitor vis) const { + vis.accept(this); + } } -enum SelectionsEnum : ubyte { +enum SelectionsEnum { Sel, Sels, Selsc, } -struct Selections { +class Selections : Node { @safe : - uint selIdx; - uint followIdx; - SelectionsEnum ruleSelection; + Selection sel; + Selections follow; + + this(SelectionsEnum ruleSelection, Selection sel) { + this.ruleSelection = ruleSelection; + this.sel = sel; + } + + this(SelectionsEnum ruleSelection, Selection sel, Selections follow) { + this.ruleSelection = ruleSelection; + this.sel = sel; + this.follow = follow; + } - static Selections ConstructSel(uint sel) { - Selections ret; - ret.ruleSelection = SelectionsEnum.Sel; - ret.selIdx = sel; - return ret; + void visit(Visitor vis) { + vis.accept(this); } - static Selections ConstructSels(uint sel, uint follow) { - Selections ret; - ret.ruleSelection = SelectionsEnum.Sels; - ret.selIdx = sel; - ret.followIdx = follow; - return ret; + void visit(Visitor vis) const { + vis.accept(this); } - static Selections ConstructSelsc(uint sel, uint follow) { - Selections ret; - ret.ruleSelection = SelectionsEnum.Selsc; - ret.selIdx = sel; - ret.followIdx = follow; - return ret; + void visit(ConstVisitor vis) { + vis.accept(this); } + void visit(ConstVisitor vis) const { + vis.accept(this); + } } -enum SelectionEnum : ubyte { +enum SelectionEnum { Field, Spread, IFrag, } -struct Selection { +class Selection : Node { @safe : - uint fragIdx; - uint fieldIdx; - uint ifragIdx; - SelectionEnum ruleSelection; + FragmentSpread frag; + Field field; + InlineFragment ifrag; + + this(SelectionEnum ruleSelection, Field field) { + this.ruleSelection = ruleSelection; + this.field = field; + } + + this(SelectionEnum ruleSelection, FragmentSpread frag) { + this.ruleSelection = ruleSelection; + this.frag = frag; + } + + this(SelectionEnum ruleSelection, InlineFragment ifrag) { + this.ruleSelection = ruleSelection; + this.ifrag = ifrag; + } - static Selection ConstructField(uint field) { - Selection ret; - ret.ruleSelection = SelectionEnum.Field; - ret.fieldIdx = field; - return ret; + void visit(Visitor vis) { + vis.accept(this); } - static Selection ConstructSpread(uint frag) { - Selection ret; - ret.ruleSelection = SelectionEnum.Spread; - ret.fragIdx = frag; - return ret; + void visit(Visitor vis) const { + vis.accept(this); } - static Selection ConstructIFrag(uint ifrag) { - Selection ret; - ret.ruleSelection = SelectionEnum.IFrag; - ret.ifragIdx = ifrag; - return ret; + void visit(ConstVisitor vis) { + vis.accept(this); } + void visit(ConstVisitor vis) const { + vis.accept(this); + } } -enum FragmentSpreadEnum : ubyte { +enum FragmentSpreadEnum { FD, F, } -struct FragmentSpread { +class FragmentSpread : Node { @safe : - uint dirsIdx; + FragmentSpreadEnum ruleSelection; + Directives dirs; Token name; - FragmentSpreadEnum ruleSelection; + this(FragmentSpreadEnum ruleSelection, Token name, Directives dirs) { + this.ruleSelection = ruleSelection; + this.name = name; + this.dirs = dirs; + } + + this(FragmentSpreadEnum ruleSelection, Token name) { + this.ruleSelection = ruleSelection; + this.name = name; + } - static FragmentSpread ConstructFD(Token name, uint dirs) { - FragmentSpread ret; - ret.ruleSelection = FragmentSpreadEnum.FD; - ret.name = name; - ret.dirsIdx = dirs; - return ret; + void visit(Visitor vis) { + vis.accept(this); } - static FragmentSpread ConstructF(Token name) { - FragmentSpread ret; - ret.ruleSelection = FragmentSpreadEnum.F; - ret.name = name; - return ret; + void visit(Visitor vis) const { + vis.accept(this); } + void visit(ConstVisitor vis) { + vis.accept(this); + } + + void visit(ConstVisitor vis) const { + vis.accept(this); + } } -enum InlineFragmentEnum : ubyte { +enum InlineFragmentEnum { TDS, TS, DS, S, } -struct InlineFragment { +class InlineFragment : Node { @safe : + InlineFragmentEnum ruleSelection; Token tc; - uint dirsIdx; - uint ssIdx; + Directives dirs; + SelectionSet ss; - InlineFragmentEnum ruleSelection; + this(InlineFragmentEnum ruleSelection, Token tc, Directives dirs, SelectionSet ss) { + this.ruleSelection = ruleSelection; + this.tc = tc; + this.dirs = dirs; + this.ss = ss; + } + + this(InlineFragmentEnum ruleSelection, Token tc, SelectionSet ss) { + this.ruleSelection = ruleSelection; + this.tc = tc; + this.ss = ss; + } - static InlineFragment ConstructTDS(Token tc, uint dirs, uint ss) { - InlineFragment ret; - ret.ruleSelection = InlineFragmentEnum.TDS; - ret.tc = tc; - ret.dirsIdx = dirs; - ret.ssIdx = ss; - return ret; + this(InlineFragmentEnum ruleSelection, Directives dirs, SelectionSet ss) { + this.ruleSelection = ruleSelection; + this.dirs = dirs; + this.ss = ss; } - static InlineFragment ConstructTS(Token tc, uint ss) { - InlineFragment ret; - ret.ruleSelection = InlineFragmentEnum.TS; - ret.tc = tc; - ret.ssIdx = ss; - return ret; + this(InlineFragmentEnum ruleSelection, SelectionSet ss) { + this.ruleSelection = ruleSelection; + this.ss = ss; } - static InlineFragment ConstructDS(uint dirs, uint ss) { - InlineFragment ret; - ret.ruleSelection = InlineFragmentEnum.DS; - ret.dirsIdx = dirs; - ret.ssIdx = ss; - return ret; + void visit(Visitor vis) { + vis.accept(this); } - static InlineFragment ConstructS(uint ss) { - InlineFragment ret; - ret.ruleSelection = InlineFragmentEnum.S; - ret.ssIdx = ss; - return ret; + void visit(Visitor vis) const { + vis.accept(this); } + void visit(ConstVisitor vis) { + vis.accept(this); + } + + void visit(ConstVisitor vis) const { + vis.accept(this); + } } -enum FieldEnum : ubyte { +enum FieldEnum { FADS, FAS, FAD, @@ -426,471 +490,587 @@ enum FieldEnum : ubyte { F, } -struct Field { +class Field : Node { @safe : - uint ssIdx; - uint argsIdx; - uint dirsIdx; - uint nameIdx; - FieldEnum ruleSelection; + SelectionSet ss; + Arguments args; + Directives dirs; + FieldName name; + + this(FieldEnum ruleSelection, FieldName name, Arguments args, Directives dirs, SelectionSet ss) { + this.ruleSelection = ruleSelection; + this.name = name; + this.args = args; + this.dirs = dirs; + this.ss = ss; + } + + this(FieldEnum ruleSelection, FieldName name, Arguments args, SelectionSet ss) { + this.ruleSelection = ruleSelection; + this.name = name; + this.args = args; + this.ss = ss; + } + + this(FieldEnum ruleSelection, FieldName name, Arguments args, Directives dirs) { + this.ruleSelection = ruleSelection; + this.name = name; + this.args = args; + this.dirs = dirs; + } - static Field ConstructFADS(uint name, uint args, uint dirs, uint ss) { - Field ret; - ret.ruleSelection = FieldEnum.FADS; - ret.nameIdx = name; - ret.argsIdx = args; - ret.dirsIdx = dirs; - ret.ssIdx = ss; - return ret; + this(FieldEnum ruleSelection, FieldName name, Directives dirs, SelectionSet ss) { + this.ruleSelection = ruleSelection; + this.name = name; + this.dirs = dirs; + this.ss = ss; } - static Field ConstructFAS(uint name, uint args, uint ss) { - Field ret; - ret.ruleSelection = FieldEnum.FAS; - ret.nameIdx = name; - ret.argsIdx = args; - ret.ssIdx = ss; - return ret; + this(FieldEnum ruleSelection, FieldName name, SelectionSet ss) { + this.ruleSelection = ruleSelection; + this.name = name; + this.ss = ss; } - static Field ConstructFAD(uint name, uint args, uint dirs) { - Field ret; - ret.ruleSelection = FieldEnum.FAD; - ret.nameIdx = name; - ret.argsIdx = args; - ret.dirsIdx = dirs; - return ret; + this(FieldEnum ruleSelection, FieldName name, Directives dirs) { + this.ruleSelection = ruleSelection; + this.name = name; + this.dirs = dirs; } - static Field ConstructFDS(uint name, uint dirs, uint ss) { - Field ret; - ret.ruleSelection = FieldEnum.FDS; - ret.nameIdx = name; - ret.dirsIdx = dirs; - ret.ssIdx = ss; - return ret; + this(FieldEnum ruleSelection, FieldName name, Arguments args) { + this.ruleSelection = ruleSelection; + this.name = name; + this.args = args; } - static Field ConstructFS(uint name, uint ss) { - Field ret; - ret.ruleSelection = FieldEnum.FS; - ret.nameIdx = name; - ret.ssIdx = ss; - return ret; + this(FieldEnum ruleSelection, FieldName name) { + this.ruleSelection = ruleSelection; + this.name = name; } - static Field ConstructFD(uint name, uint dirs) { - Field ret; - ret.ruleSelection = FieldEnum.FD; - ret.nameIdx = name; - ret.dirsIdx = dirs; - return ret; + void visit(Visitor vis) { + vis.accept(this); } - static Field ConstructFA(uint name, uint args) { - Field ret; - ret.ruleSelection = FieldEnum.FA; - ret.nameIdx = name; - ret.argsIdx = args; - return ret; + void visit(Visitor vis) const { + vis.accept(this); } - static Field ConstructF(uint name) { - Field ret; - ret.ruleSelection = FieldEnum.F; - ret.nameIdx = name; - return ret; + void visit(ConstVisitor vis) { + vis.accept(this); } + void visit(ConstVisitor vis) const { + vis.accept(this); + } } -enum FieldNameEnum : ubyte { +enum FieldNameEnum { A, N, } -struct FieldName { +class FieldName : Node { @safe : + FieldNameEnum ruleSelection; Token aka; Token name; - FieldNameEnum ruleSelection; + this(FieldNameEnum ruleSelection, Token name, Token aka) { + this.ruleSelection = ruleSelection; + this.name = name; + this.aka = aka; + } - static FieldName ConstructA(Token name, Token aka) { - FieldName ret; - ret.ruleSelection = FieldNameEnum.A; - ret.name = name; - ret.aka = aka; - return ret; + this(FieldNameEnum ruleSelection, Token name) { + this.ruleSelection = ruleSelection; + this.name = name; } - static FieldName ConstructN(Token name) { - FieldName ret; - ret.ruleSelection = FieldNameEnum.N; - ret.name = name; - return ret; + void visit(Visitor vis) { + vis.accept(this); } + void visit(Visitor vis) const { + vis.accept(this); + } + + void visit(ConstVisitor vis) { + vis.accept(this); + } + + void visit(ConstVisitor vis) const { + vis.accept(this); + } } -enum ArgumentsEnum : ubyte { +enum ArgumentsEnum { List, Empty, } -struct Arguments { +class Arguments : Node { @safe : - uint argIdx; - ArgumentsEnum ruleSelection; + ArgumentList arg; + + this(ArgumentsEnum ruleSelection, ArgumentList arg) { + this.ruleSelection = ruleSelection; + this.arg = arg; + } + + this(ArgumentsEnum ruleSelection) { + this.ruleSelection = ruleSelection; + } - static Arguments ConstructList(uint arg) { - Arguments ret; - ret.ruleSelection = ArgumentsEnum.List; - ret.argIdx = arg; - return ret; + void visit(Visitor vis) { + vis.accept(this); } - static Arguments ConstructEmpty() { - Arguments ret; - ret.ruleSelection = ArgumentsEnum.Empty; + void visit(Visitor vis) const { + vis.accept(this); + } - return ret; + void visit(ConstVisitor vis) { + vis.accept(this); } + void visit(ConstVisitor vis) const { + vis.accept(this); + } } -enum ArgumentListEnum : ubyte { +enum ArgumentListEnum { A, ACS, AS, } -struct ArgumentList { +class ArgumentList : Node { @safe : - uint argIdx; - uint followIdx; - ArgumentListEnum ruleSelection; + Argument arg; + ArgumentList follow; + + this(ArgumentListEnum ruleSelection, Argument arg) { + this.ruleSelection = ruleSelection; + this.arg = arg; + } + + this(ArgumentListEnum ruleSelection, Argument arg, ArgumentList follow) { + this.ruleSelection = ruleSelection; + this.arg = arg; + this.follow = follow; + } - static ArgumentList ConstructA(uint arg) { - ArgumentList ret; - ret.ruleSelection = ArgumentListEnum.A; - ret.argIdx = arg; - return ret; + void visit(Visitor vis) { + vis.accept(this); } - static ArgumentList ConstructACS(uint arg, uint follow) { - ArgumentList ret; - ret.ruleSelection = ArgumentListEnum.ACS; - ret.argIdx = arg; - ret.followIdx = follow; - return ret; + void visit(Visitor vis) const { + vis.accept(this); } - static ArgumentList ConstructAS(uint arg, uint follow) { - ArgumentList ret; - ret.ruleSelection = ArgumentListEnum.AS; - ret.argIdx = arg; - ret.followIdx = follow; - return ret; + void visit(ConstVisitor vis) { + vis.accept(this); } + void visit(ConstVisitor vis) const { + vis.accept(this); + } } -enum ArgumentEnum : ubyte { +enum ArgumentEnum { Name, } -struct Argument { +class Argument : Node { @safe : - uint vvIdx; + ArgumentEnum ruleSelection; + ValueOrVariable vv; Token name; - ArgumentEnum ruleSelection; + this(ArgumentEnum ruleSelection, Token name, ValueOrVariable vv) { + this.ruleSelection = ruleSelection; + this.name = name; + this.vv = vv; + } - static Argument ConstructName(Token name, uint vv) { - Argument ret; - ret.ruleSelection = ArgumentEnum.Name; - ret.name = name; - ret.vvIdx = vv; - return ret; + void visit(Visitor vis) { + vis.accept(this); } + void visit(Visitor vis) const { + vis.accept(this); + } + + void visit(ConstVisitor vis) { + vis.accept(this); + } + + void visit(ConstVisitor vis) const { + vis.accept(this); + } } -enum FragmentDefinitionEnum : ubyte { +enum FragmentDefinitionEnum { FTDS, FTS, } -struct FragmentDefinition { +class FragmentDefinition : Node { @safe : - uint ssIdx; + FragmentDefinitionEnum ruleSelection; + SelectionSet ss; Token tc; - uint dirsIdx; + Directives dirs; Token name; - FragmentDefinitionEnum ruleSelection; + this(FragmentDefinitionEnum ruleSelection, Token name, Token tc, Directives dirs, SelectionSet ss) { + this.ruleSelection = ruleSelection; + this.name = name; + this.tc = tc; + this.dirs = dirs; + this.ss = ss; + } + + this(FragmentDefinitionEnum ruleSelection, Token name, Token tc, SelectionSet ss) { + this.ruleSelection = ruleSelection; + this.name = name; + this.tc = tc; + this.ss = ss; + } + + void visit(Visitor vis) { + vis.accept(this); + } - static FragmentDefinition ConstructFTDS(Token name, Token tc, uint dirs, uint ss) { - FragmentDefinition ret; - ret.ruleSelection = FragmentDefinitionEnum.FTDS; - ret.name = name; - ret.tc = tc; - ret.dirsIdx = dirs; - ret.ssIdx = ss; - return ret; + void visit(Visitor vis) const { + vis.accept(this); } - static FragmentDefinition ConstructFTS(Token name, Token tc, uint ss) { - FragmentDefinition ret; - ret.ruleSelection = FragmentDefinitionEnum.FTS; - ret.name = name; - ret.tc = tc; - ret.ssIdx = ss; - return ret; + void visit(ConstVisitor vis) { + vis.accept(this); } + void visit(ConstVisitor vis) const { + vis.accept(this); + } } -enum DirectivesEnum : ubyte { +enum DirectivesEnum { Dir, Dirs, } -struct Directives { +class Directives : Node { @safe : - uint dirIdx; - uint followIdx; - DirectivesEnum ruleSelection; + Directive dir; + Directives follow; - static Directives ConstructDir(uint dir) { - Directives ret; - ret.ruleSelection = DirectivesEnum.Dir; - ret.dirIdx = dir; - return ret; + this(DirectivesEnum ruleSelection, Directive dir) { + this.ruleSelection = ruleSelection; + this.dir = dir; } - static Directives ConstructDirs(uint dir, uint follow) { - Directives ret; - ret.ruleSelection = DirectivesEnum.Dirs; - ret.dirIdx = dir; - ret.followIdx = follow; - return ret; + this(DirectivesEnum ruleSelection, Directive dir, Directives follow) { + this.ruleSelection = ruleSelection; + this.dir = dir; + this.follow = follow; } + void visit(Visitor vis) { + vis.accept(this); + } + + void visit(Visitor vis) const { + vis.accept(this); + } + + void visit(ConstVisitor vis) { + vis.accept(this); + } + + void visit(ConstVisitor vis) const { + vis.accept(this); + } } -enum DirectiveEnum : ubyte { +enum DirectiveEnum { NArg, N, } -struct Directive { +class Directive : Node { @safe : - uint argIdx; + DirectiveEnum ruleSelection; + Arguments arg; Token name; - DirectiveEnum ruleSelection; + this(DirectiveEnum ruleSelection, Token name, Arguments arg) { + this.ruleSelection = ruleSelection; + this.name = name; + this.arg = arg; + } + + this(DirectiveEnum ruleSelection, Token name) { + this.ruleSelection = ruleSelection; + this.name = name; + } - static Directive ConstructNArg(Token name, uint arg) { - Directive ret; - ret.ruleSelection = DirectiveEnum.NArg; - ret.name = name; - ret.argIdx = arg; - return ret; + void visit(Visitor vis) { + vis.accept(this); } - static Directive ConstructN(Token name) { - Directive ret; - ret.ruleSelection = DirectiveEnum.N; - ret.name = name; - return ret; + void visit(Visitor vis) const { + vis.accept(this); } + void visit(ConstVisitor vis) { + vis.accept(this); + } + + void visit(ConstVisitor vis) const { + vis.accept(this); + } } -enum VariableDefinitionsEnum : ubyte { +enum VariableDefinitionsEnum { Empty, Vars, } -struct VariableDefinitions { +class VariableDefinitions : Node { @safe : - uint varsIdx; - VariableDefinitionsEnum ruleSelection; + VariableDefinitionList vars; + + this(VariableDefinitionsEnum ruleSelection) { + this.ruleSelection = ruleSelection; + } - static VariableDefinitions ConstructEmpty() { - VariableDefinitions ret; - ret.ruleSelection = VariableDefinitionsEnum.Empty; + this(VariableDefinitionsEnum ruleSelection, VariableDefinitionList vars) { + this.ruleSelection = ruleSelection; + this.vars = vars; + } - return ret; + void visit(Visitor vis) { + vis.accept(this); } - static VariableDefinitions ConstructVars(uint vars) { - VariableDefinitions ret; - ret.ruleSelection = VariableDefinitionsEnum.Vars; - ret.varsIdx = vars; - return ret; + void visit(Visitor vis) const { + vis.accept(this); } + void visit(ConstVisitor vis) { + vis.accept(this); + } + + void visit(ConstVisitor vis) const { + vis.accept(this); + } } -enum VariableDefinitionListEnum : ubyte { +enum VariableDefinitionListEnum { V, VCF, VF, } -struct VariableDefinitionList { +class VariableDefinitionList : Node { @safe : - uint followIdx; - uint varIdx; - VariableDefinitionListEnum ruleSelection; + VariableDefinitionList follow; + VariableDefinition var; + + this(VariableDefinitionListEnum ruleSelection, VariableDefinition var) { + this.ruleSelection = ruleSelection; + this.var = var; + } - static VariableDefinitionList ConstructV(uint var) { - VariableDefinitionList ret; - ret.ruleSelection = VariableDefinitionListEnum.V; - ret.varIdx = var; - return ret; + this(VariableDefinitionListEnum ruleSelection, VariableDefinition var, VariableDefinitionList follow) { + this.ruleSelection = ruleSelection; + this.var = var; + this.follow = follow; } - static VariableDefinitionList ConstructVCF(uint var, uint follow) { - VariableDefinitionList ret; - ret.ruleSelection = VariableDefinitionListEnum.VCF; - ret.varIdx = var; - ret.followIdx = follow; - return ret; + void visit(Visitor vis) { + vis.accept(this); } - static VariableDefinitionList ConstructVF(uint var, uint follow) { - VariableDefinitionList ret; - ret.ruleSelection = VariableDefinitionListEnum.VF; - ret.varIdx = var; - ret.followIdx = follow; - return ret; + void visit(Visitor vis) const { + vis.accept(this); } + void visit(ConstVisitor vis) { + vis.accept(this); + } + + void visit(ConstVisitor vis) const { + vis.accept(this); + } } -enum VariableDefinitionEnum : ubyte { +enum VariableDefinitionEnum { VarD, Var, } -struct VariableDefinition { +class VariableDefinition : Node { @safe : - uint typeIdx; - uint dvalueIdx; - uint varIdx; - VariableDefinitionEnum ruleSelection; + Type type; + DefaultValue dvalue; + Variable var; - static VariableDefinition ConstructVarD(uint var, uint type, uint dvalue) { - VariableDefinition ret; - ret.ruleSelection = VariableDefinitionEnum.VarD; - ret.varIdx = var; - ret.typeIdx = type; - ret.dvalueIdx = dvalue; - return ret; + this(VariableDefinitionEnum ruleSelection, Variable var, Type type, DefaultValue dvalue) { + this.ruleSelection = ruleSelection; + this.var = var; + this.type = type; + this.dvalue = dvalue; } - static VariableDefinition ConstructVar(uint var, uint type) { - VariableDefinition ret; - ret.ruleSelection = VariableDefinitionEnum.Var; - ret.varIdx = var; - ret.typeIdx = type; - return ret; + this(VariableDefinitionEnum ruleSelection, Variable var, Type type) { + this.ruleSelection = ruleSelection; + this.var = var; + this.type = type; } + void visit(Visitor vis) { + vis.accept(this); + } + + void visit(Visitor vis) const { + vis.accept(this); + } + + void visit(ConstVisitor vis) { + vis.accept(this); + } + + void visit(ConstVisitor vis) const { + vis.accept(this); + } } -enum VariableEnum : ubyte { +enum VariableEnum { Var, } -struct Variable { +class Variable : Node { @safe : + VariableEnum ruleSelection; Token name; - VariableEnum ruleSelection; + this(VariableEnum ruleSelection, Token name) { + this.ruleSelection = ruleSelection; + this.name = name; + } + + void visit(Visitor vis) { + vis.accept(this); + } + + void visit(Visitor vis) const { + vis.accept(this); + } - static Variable ConstructVar(Token name) { - Variable ret; - ret.ruleSelection = VariableEnum.Var; - ret.name = name; - return ret; + void visit(ConstVisitor vis) { + vis.accept(this); } + void visit(ConstVisitor vis) const { + vis.accept(this); + } } -enum DefaultValueEnum : ubyte { +enum DefaultValueEnum { DV, } -struct DefaultValue { +class DefaultValue : Node { @safe : - uint valueIdx; - DefaultValueEnum ruleSelection; + Value value; + + this(DefaultValueEnum ruleSelection, Value value) { + this.ruleSelection = ruleSelection; + this.value = value; + } - static DefaultValue ConstructDV(uint value) { - DefaultValue ret; - ret.ruleSelection = DefaultValueEnum.DV; - ret.valueIdx = value; - return ret; + void visit(Visitor vis) { + vis.accept(this); } + void visit(Visitor vis) const { + vis.accept(this); + } + + void visit(ConstVisitor vis) { + vis.accept(this); + } + + void visit(ConstVisitor vis) const { + vis.accept(this); + } } -enum ValueOrVariableEnum : ubyte { +enum ValueOrVariableEnum { Val, Var, } -struct ValueOrVariable { +class ValueOrVariable : Node { @safe : - uint valIdx; - uint varIdx; - ValueOrVariableEnum ruleSelection; + Value val; + Variable var; + + this(ValueOrVariableEnum ruleSelection, Value val) { + this.ruleSelection = ruleSelection; + this.val = val; + } + + this(ValueOrVariableEnum ruleSelection, Variable var) { + this.ruleSelection = ruleSelection; + this.var = var; + } - static ValueOrVariable ConstructVal(uint val) { - ValueOrVariable ret; - ret.ruleSelection = ValueOrVariableEnum.Val; - ret.valIdx = val; - return ret; + void visit(Visitor vis) { + vis.accept(this); } - static ValueOrVariable ConstructVar(uint var) { - ValueOrVariable ret; - ret.ruleSelection = ValueOrVariableEnum.Var; - ret.varIdx = var; - return ret; + void visit(Visitor vis) const { + vis.accept(this); } + void visit(ConstVisitor vis) { + vis.accept(this); + } + + void visit(ConstVisitor vis) const { + vis.accept(this); + } } -enum ValueEnum : ubyte { +enum ValueEnum { STR, INT, FLOAT, @@ -902,276 +1082,274 @@ enum ValueEnum : ubyte { N, } -struct Value { +class Value : Node { @safe : - Token tok; - uint arrIdx; - uint objIdx; - ValueEnum ruleSelection; + Token tok; + Array arr; + ObjectType obj; - static Value ConstructSTR(Token tok) { - Value ret; - ret.ruleSelection = ValueEnum.STR; - ret.tok = tok; - return ret; - } - - static Value ConstructINT(Token tok) { - Value ret; - ret.ruleSelection = ValueEnum.INT; - ret.tok = tok; - return ret; - } - - static Value ConstructFLOAT(Token tok) { - Value ret; - ret.ruleSelection = ValueEnum.FLOAT; - ret.tok = tok; - return ret; + this(ValueEnum ruleSelection, Token tok) { + this.ruleSelection = ruleSelection; + this.tok = tok; } - static Value ConstructT(Token tok) { - Value ret; - ret.ruleSelection = ValueEnum.T; - ret.tok = tok; - return ret; + this(ValueEnum ruleSelection, Array arr) { + this.ruleSelection = ruleSelection; + this.arr = arr; } - static Value ConstructF(Token tok) { - Value ret; - ret.ruleSelection = ValueEnum.F; - ret.tok = tok; - return ret; + this(ValueEnum ruleSelection, ObjectType obj) { + this.ruleSelection = ruleSelection; + this.obj = obj; } - static Value ConstructARR(uint arr) { - Value ret; - ret.ruleSelection = ValueEnum.ARR; - ret.arrIdx = arr; - return ret; + void visit(Visitor vis) { + vis.accept(this); } - static Value ConstructO(uint obj) { - Value ret; - ret.ruleSelection = ValueEnum.O; - ret.objIdx = obj; - return ret; + void visit(Visitor vis) const { + vis.accept(this); } - static Value ConstructE(Token tok) { - Value ret; - ret.ruleSelection = ValueEnum.E; - ret.tok = tok; - return ret; + void visit(ConstVisitor vis) { + vis.accept(this); } - static Value ConstructN(Token tok) { - Value ret; - ret.ruleSelection = ValueEnum.N; - ret.tok = tok; - return ret; + void visit(ConstVisitor vis) const { + vis.accept(this); } - } -enum TypeEnum : ubyte { +enum TypeEnum { TN, LN, T, L, } -struct Type { +class Type : Node { @safe : - uint listIdx; + TypeEnum ruleSelection; + ListType list; Token tname; - TypeEnum ruleSelection; + this(TypeEnum ruleSelection, Token tname) { + this.ruleSelection = ruleSelection; + this.tname = tname; + } - static Type ConstructTN(Token tname) { - Type ret; - ret.ruleSelection = TypeEnum.TN; - ret.tname = tname; - return ret; + this(TypeEnum ruleSelection, ListType list) { + this.ruleSelection = ruleSelection; + this.list = list; } - static Type ConstructLN(uint list) { - Type ret; - ret.ruleSelection = TypeEnum.LN; - ret.listIdx = list; - return ret; + void visit(Visitor vis) { + vis.accept(this); } - static Type ConstructT(Token tname) { - Type ret; - ret.ruleSelection = TypeEnum.T; - ret.tname = tname; - return ret; + void visit(Visitor vis) const { + vis.accept(this); } - static Type ConstructL(uint list) { - Type ret; - ret.ruleSelection = TypeEnum.L; - ret.listIdx = list; - return ret; + void visit(ConstVisitor vis) { + vis.accept(this); } + void visit(ConstVisitor vis) const { + vis.accept(this); + } } -enum ListTypeEnum : ubyte { +enum ListTypeEnum { T, } -struct ListType { +class ListType : Node { @safe : - uint typeIdx; - ListTypeEnum ruleSelection; + Type type; + + this(ListTypeEnum ruleSelection, Type type) { + this.ruleSelection = ruleSelection; + this.type = type; + } + + void visit(Visitor vis) { + vis.accept(this); + } + + void visit(Visitor vis) const { + vis.accept(this); + } - static ListType ConstructT(uint type) { - ListType ret; - ret.ruleSelection = ListTypeEnum.T; - ret.typeIdx = type; - return ret; + void visit(ConstVisitor vis) { + vis.accept(this); } + void visit(ConstVisitor vis) const { + vis.accept(this); + } } -enum ValuesEnum : ubyte { +enum ValuesEnum { Val, Vals, ValsNoComma, } -struct Values { +class Values : Node { @safe : - uint valIdx; - uint followIdx; - ValuesEnum ruleSelection; + Value val; + Values follow; + + this(ValuesEnum ruleSelection, Value val) { + this.ruleSelection = ruleSelection; + this.val = val; + } + + this(ValuesEnum ruleSelection, Value val, Values follow) { + this.ruleSelection = ruleSelection; + this.val = val; + this.follow = follow; + } - static Values ConstructVal(uint val) { - Values ret; - ret.ruleSelection = ValuesEnum.Val; - ret.valIdx = val; - return ret; + void visit(Visitor vis) { + vis.accept(this); } - static Values ConstructVals(uint val, uint follow) { - Values ret; - ret.ruleSelection = ValuesEnum.Vals; - ret.valIdx = val; - ret.followIdx = follow; - return ret; + void visit(Visitor vis) const { + vis.accept(this); } - static Values ConstructValsNoComma(uint val, uint follow) { - Values ret; - ret.ruleSelection = ValuesEnum.ValsNoComma; - ret.valIdx = val; - ret.followIdx = follow; - return ret; + void visit(ConstVisitor vis) { + vis.accept(this); } + void visit(ConstVisitor vis) const { + vis.accept(this); + } } -enum ArrayEnum : ubyte { +enum ArrayEnum { Empty, Value, } -struct Array { +class Array : Node { @safe : - uint valsIdx; - ArrayEnum ruleSelection; + Values vals; + + this(ArrayEnum ruleSelection) { + this.ruleSelection = ruleSelection; + } - static Array ConstructEmpty() { - Array ret; - ret.ruleSelection = ArrayEnum.Empty; + this(ArrayEnum ruleSelection, Values vals) { + this.ruleSelection = ruleSelection; + this.vals = vals; + } + + void visit(Visitor vis) { + vis.accept(this); + } - return ret; + void visit(Visitor vis) const { + vis.accept(this); } - static Array ConstructValue(uint vals) { - Array ret; - ret.ruleSelection = ArrayEnum.Value; - ret.valsIdx = vals; - return ret; + void visit(ConstVisitor vis) { + vis.accept(this); } + void visit(ConstVisitor vis) const { + vis.accept(this); + } } -enum ObjectValuesEnum : ubyte { +enum ObjectValuesEnum { V, Vsc, Vs, } -struct ObjectValues { +class ObjectValues : Node { @safe : - uint valIdx; - uint followIdx; + ObjectValuesEnum ruleSelection; + ValueOrVariable val; + ObjectValues follow; Token name; - ObjectValuesEnum ruleSelection; + this(ObjectValuesEnum ruleSelection, Token name, ValueOrVariable val) { + this.ruleSelection = ruleSelection; + this.name = name; + this.val = val; + } - static ObjectValues ConstructV(Token name, uint val) { - ObjectValues ret; - ret.ruleSelection = ObjectValuesEnum.V; - ret.name = name; - ret.valIdx = val; - return ret; + this(ObjectValuesEnum ruleSelection, Token name, ValueOrVariable val, ObjectValues follow) { + this.ruleSelection = ruleSelection; + this.name = name; + this.val = val; + this.follow = follow; } - static ObjectValues ConstructVsc(Token name, uint val, uint follow) { - ObjectValues ret; - ret.ruleSelection = ObjectValuesEnum.Vsc; - ret.name = name; - ret.valIdx = val; - ret.followIdx = follow; - return ret; + void visit(Visitor vis) { + vis.accept(this); } - static ObjectValues ConstructVs(Token name, uint val, uint follow) { - ObjectValues ret; - ret.ruleSelection = ObjectValuesEnum.Vs; - ret.name = name; - ret.valIdx = val; - ret.followIdx = follow; - return ret; + void visit(Visitor vis) const { + vis.accept(this); } + void visit(ConstVisitor vis) { + vis.accept(this); + } + + void visit(ConstVisitor vis) const { + vis.accept(this); + } } -enum ObjectTypeEnum : ubyte { +enum ObjectTypeEnum { Var, } -struct ObjectType { +class ObjectType : Node { @safe : - uint valsIdx; - ObjectTypeEnum ruleSelection; + ObjectValues vals; + + this(ObjectTypeEnum ruleSelection, ObjectValues vals) { + this.ruleSelection = ruleSelection; + this.vals = vals; + } + + void visit(Visitor vis) { + vis.accept(this); + } + + void visit(Visitor vis) const { + vis.accept(this); + } - static ObjectType ConstructVar(uint vals) { - ObjectType ret; - ret.ruleSelection = ObjectTypeEnum.Var; - ret.valsIdx = vals; - return ret; + void visit(ConstVisitor vis) { + vis.accept(this); } + void visit(ConstVisitor vis) const { + vis.accept(this); + } } -enum TypeSystemDefinitionEnum : ubyte { +enum TypeSystemDefinitionEnum { S, T, TE, @@ -1182,80 +1360,78 @@ enum TypeSystemDefinitionEnum : ubyte { DD, } -struct TypeSystemDefinition { +class TypeSystemDefinition : Node { @safe : - uint desIdx; - uint ddIdx; - uint tedIdx; - uint schIdx; - uint tdIdx; - TypeSystemDefinitionEnum ruleSelection; + Description des; + DirectiveDefinition dd; + TypeExtensionDefinition ted; + SchemaDefinition sch; + TypeDefinition td; + + this(TypeSystemDefinitionEnum ruleSelection, SchemaDefinition sch) { + this.ruleSelection = ruleSelection; + this.sch = sch; + } + + this(TypeSystemDefinitionEnum ruleSelection, TypeDefinition td) { + this.ruleSelection = ruleSelection; + this.td = td; + } + + this(TypeSystemDefinitionEnum ruleSelection, TypeExtensionDefinition ted) { + this.ruleSelection = ruleSelection; + this.ted = ted; + } - static TypeSystemDefinition ConstructS(uint sch) { - TypeSystemDefinition ret; - ret.ruleSelection = TypeSystemDefinitionEnum.S; - ret.schIdx = sch; - return ret; + this(TypeSystemDefinitionEnum ruleSelection, DirectiveDefinition dd) { + this.ruleSelection = ruleSelection; + this.dd = dd; } - static TypeSystemDefinition ConstructT(uint td) { - TypeSystemDefinition ret; - ret.ruleSelection = TypeSystemDefinitionEnum.T; - ret.tdIdx = td; - return ret; + this(TypeSystemDefinitionEnum ruleSelection, Description des, SchemaDefinition sch) { + this.ruleSelection = ruleSelection; + this.des = des; + this.sch = sch; } - static TypeSystemDefinition ConstructTE(uint ted) { - TypeSystemDefinition ret; - ret.ruleSelection = TypeSystemDefinitionEnum.TE; - ret.tedIdx = ted; - return ret; + this(TypeSystemDefinitionEnum ruleSelection, Description des, TypeDefinition td) { + this.ruleSelection = ruleSelection; + this.des = des; + this.td = td; } - static TypeSystemDefinition ConstructD(uint dd) { - TypeSystemDefinition ret; - ret.ruleSelection = TypeSystemDefinitionEnum.D; - ret.ddIdx = dd; - return ret; + this(TypeSystemDefinitionEnum ruleSelection, Description des, TypeExtensionDefinition ted) { + this.ruleSelection = ruleSelection; + this.des = des; + this.ted = ted; } - static TypeSystemDefinition ConstructDS(uint des, uint sch) { - TypeSystemDefinition ret; - ret.ruleSelection = TypeSystemDefinitionEnum.DS; - ret.desIdx = des; - ret.schIdx = sch; - return ret; + this(TypeSystemDefinitionEnum ruleSelection, Description des, DirectiveDefinition dd) { + this.ruleSelection = ruleSelection; + this.des = des; + this.dd = dd; } - static TypeSystemDefinition ConstructDT(uint des, uint td) { - TypeSystemDefinition ret; - ret.ruleSelection = TypeSystemDefinitionEnum.DT; - ret.desIdx = des; - ret.tdIdx = td; - return ret; + void visit(Visitor vis) { + vis.accept(this); } - static TypeSystemDefinition ConstructDTE(uint des, uint ted) { - TypeSystemDefinition ret; - ret.ruleSelection = TypeSystemDefinitionEnum.DTE; - ret.desIdx = des; - ret.tedIdx = ted; - return ret; + void visit(Visitor vis) const { + vis.accept(this); } - static TypeSystemDefinition ConstructDD(uint des, uint dd) { - TypeSystemDefinition ret; - ret.ruleSelection = TypeSystemDefinitionEnum.DD; - ret.desIdx = des; - ret.ddIdx = dd; - return ret; + void visit(ConstVisitor vis) { + vis.accept(this); } + void visit(ConstVisitor vis) const { + vis.accept(this); + } } -enum TypeDefinitionEnum : ubyte { +enum TypeDefinitionEnum { S, O, I, @@ -1264,278 +1440,322 @@ enum TypeDefinitionEnum : ubyte { IO, } -struct TypeDefinition { +class TypeDefinition : Node { @safe : - uint otdIdx; - uint stdIdx; - uint utdIdx; - uint itdIdx; - uint etdIdx; - uint iodIdx; - TypeDefinitionEnum ruleSelection; + ObjectTypeDefinition otd; + ScalarTypeDefinition std; + UnionTypeDefinition utd; + InterfaceTypeDefinition itd; + EnumTypeDefinition etd; + InputObjectTypeDefinition iod; + + this(TypeDefinitionEnum ruleSelection, ScalarTypeDefinition std) { + this.ruleSelection = ruleSelection; + this.std = std; + } - static TypeDefinition ConstructS(uint std) { - TypeDefinition ret; - ret.ruleSelection = TypeDefinitionEnum.S; - ret.stdIdx = std; - return ret; + this(TypeDefinitionEnum ruleSelection, ObjectTypeDefinition otd) { + this.ruleSelection = ruleSelection; + this.otd = otd; } - static TypeDefinition ConstructO(uint otd) { - TypeDefinition ret; - ret.ruleSelection = TypeDefinitionEnum.O; - ret.otdIdx = otd; - return ret; + this(TypeDefinitionEnum ruleSelection, InterfaceTypeDefinition itd) { + this.ruleSelection = ruleSelection; + this.itd = itd; } - static TypeDefinition ConstructI(uint itd) { - TypeDefinition ret; - ret.ruleSelection = TypeDefinitionEnum.I; - ret.itdIdx = itd; - return ret; + this(TypeDefinitionEnum ruleSelection, UnionTypeDefinition utd) { + this.ruleSelection = ruleSelection; + this.utd = utd; } - static TypeDefinition ConstructU(uint utd) { - TypeDefinition ret; - ret.ruleSelection = TypeDefinitionEnum.U; - ret.utdIdx = utd; - return ret; + this(TypeDefinitionEnum ruleSelection, EnumTypeDefinition etd) { + this.ruleSelection = ruleSelection; + this.etd = etd; } - static TypeDefinition ConstructE(uint etd) { - TypeDefinition ret; - ret.ruleSelection = TypeDefinitionEnum.E; - ret.etdIdx = etd; - return ret; + this(TypeDefinitionEnum ruleSelection, InputObjectTypeDefinition iod) { + this.ruleSelection = ruleSelection; + this.iod = iod; } - static TypeDefinition ConstructIO(uint iod) { - TypeDefinition ret; - ret.ruleSelection = TypeDefinitionEnum.IO; - ret.iodIdx = iod; - return ret; + void visit(Visitor vis) { + vis.accept(this); } + void visit(Visitor vis) const { + vis.accept(this); + } + + void visit(ConstVisitor vis) { + vis.accept(this); + } + + void visit(ConstVisitor vis) const { + vis.accept(this); + } } -enum SchemaDefinitionEnum : ubyte { +enum SchemaDefinitionEnum { DO, O, } -struct SchemaDefinition { +class SchemaDefinition : Node { @safe : - uint dirIdx; - uint otdsIdx; - SchemaDefinitionEnum ruleSelection; + Directives dir; + OperationTypeDefinitions otds; + + this(SchemaDefinitionEnum ruleSelection, Directives dir, OperationTypeDefinitions otds) { + this.ruleSelection = ruleSelection; + this.dir = dir; + this.otds = otds; + } + + this(SchemaDefinitionEnum ruleSelection, OperationTypeDefinitions otds) { + this.ruleSelection = ruleSelection; + this.otds = otds; + } - static SchemaDefinition ConstructDO(uint dir, uint otds) { - SchemaDefinition ret; - ret.ruleSelection = SchemaDefinitionEnum.DO; - ret.dirIdx = dir; - ret.otdsIdx = otds; - return ret; + void visit(Visitor vis) { + vis.accept(this); } - static SchemaDefinition ConstructO(uint otds) { - SchemaDefinition ret; - ret.ruleSelection = SchemaDefinitionEnum.O; - ret.otdsIdx = otds; - return ret; + void visit(Visitor vis) const { + vis.accept(this); } + void visit(ConstVisitor vis) { + vis.accept(this); + } + + void visit(ConstVisitor vis) const { + vis.accept(this); + } } -enum OperationTypeDefinitionsEnum : ubyte { +enum OperationTypeDefinitionsEnum { O, OCS, OS, } -struct OperationTypeDefinitions { +class OperationTypeDefinitions : Node { @safe : - uint otdIdx; - uint followIdx; - OperationTypeDefinitionsEnum ruleSelection; + OperationTypeDefinition otd; + OperationTypeDefinitions follow; - static OperationTypeDefinitions ConstructO(uint otd) { - OperationTypeDefinitions ret; - ret.ruleSelection = OperationTypeDefinitionsEnum.O; - ret.otdIdx = otd; - return ret; + this(OperationTypeDefinitionsEnum ruleSelection, OperationTypeDefinition otd) { + this.ruleSelection = ruleSelection; + this.otd = otd; } - static OperationTypeDefinitions ConstructOCS(uint otd, uint follow) { - OperationTypeDefinitions ret; - ret.ruleSelection = OperationTypeDefinitionsEnum.OCS; - ret.otdIdx = otd; - ret.followIdx = follow; - return ret; + this(OperationTypeDefinitionsEnum ruleSelection, OperationTypeDefinition otd, OperationTypeDefinitions follow) { + this.ruleSelection = ruleSelection; + this.otd = otd; + this.follow = follow; } - static OperationTypeDefinitions ConstructOS(uint otd, uint follow) { - OperationTypeDefinitions ret; - ret.ruleSelection = OperationTypeDefinitionsEnum.OS; - ret.otdIdx = otd; - ret.followIdx = follow; - return ret; + void visit(Visitor vis) { + vis.accept(this); } + void visit(Visitor vis) const { + vis.accept(this); + } + + void visit(ConstVisitor vis) { + vis.accept(this); + } + + void visit(ConstVisitor vis) const { + vis.accept(this); + } } -enum OperationTypeDefinitionEnum : ubyte { +enum OperationTypeDefinitionEnum { O, } -struct OperationTypeDefinition { +class OperationTypeDefinition : Node { @safe : - uint otIdx; + OperationTypeDefinitionEnum ruleSelection; + OperationType ot; Token nt; - OperationTypeDefinitionEnum ruleSelection; + this(OperationTypeDefinitionEnum ruleSelection, OperationType ot, Token nt) { + this.ruleSelection = ruleSelection; + this.ot = ot; + this.nt = nt; + } + + void visit(Visitor vis) { + vis.accept(this); + } - static OperationTypeDefinition ConstructO(uint ot, Token nt) { - OperationTypeDefinition ret; - ret.ruleSelection = OperationTypeDefinitionEnum.O; - ret.otIdx = ot; - ret.nt = nt; - return ret; + void visit(Visitor vis) const { + vis.accept(this); } + void visit(ConstVisitor vis) { + vis.accept(this); + } + + void visit(ConstVisitor vis) const { + vis.accept(this); + } } -enum ScalarTypeDefinitionEnum : ubyte { +enum ScalarTypeDefinitionEnum { D, S, } -struct ScalarTypeDefinition { +class ScalarTypeDefinition : Node { @safe : - uint dirIdx; + ScalarTypeDefinitionEnum ruleSelection; + Directives dir; Token name; - ScalarTypeDefinitionEnum ruleSelection; + this(ScalarTypeDefinitionEnum ruleSelection, Token name, Directives dir) { + this.ruleSelection = ruleSelection; + this.name = name; + this.dir = dir; + } + + this(ScalarTypeDefinitionEnum ruleSelection, Token name) { + this.ruleSelection = ruleSelection; + this.name = name; + } + + void visit(Visitor vis) { + vis.accept(this); + } - static ScalarTypeDefinition ConstructD(Token name, uint dir) { - ScalarTypeDefinition ret; - ret.ruleSelection = ScalarTypeDefinitionEnum.D; - ret.name = name; - ret.dirIdx = dir; - return ret; + void visit(Visitor vis) const { + vis.accept(this); } - static ScalarTypeDefinition ConstructS(Token name) { - ScalarTypeDefinition ret; - ret.ruleSelection = ScalarTypeDefinitionEnum.S; - ret.name = name; - return ret; + void visit(ConstVisitor vis) { + vis.accept(this); } + void visit(ConstVisitor vis) const { + vis.accept(this); + } } -enum ObjectTypeDefinitionEnum : ubyte { +enum ObjectTypeDefinitionEnum { ID, I, D, F, } -struct ObjectTypeDefinition { +class ObjectTypeDefinition : Node { @safe : - uint dirIdx; - uint iiIdx; - uint fdsIdx; + ObjectTypeDefinitionEnum ruleSelection; + Directives dir; + ImplementsInterfaces ii; + FieldDefinitions fds; Token name; - ObjectTypeDefinitionEnum ruleSelection; + this(ObjectTypeDefinitionEnum ruleSelection, Token name, ImplementsInterfaces ii, Directives dir, FieldDefinitions fds) { + this.ruleSelection = ruleSelection; + this.name = name; + this.ii = ii; + this.dir = dir; + this.fds = fds; + } - static ObjectTypeDefinition ConstructID(Token name, uint ii, uint dir, uint fds) { - ObjectTypeDefinition ret; - ret.ruleSelection = ObjectTypeDefinitionEnum.ID; - ret.name = name; - ret.iiIdx = ii; - ret.dirIdx = dir; - ret.fdsIdx = fds; - return ret; + this(ObjectTypeDefinitionEnum ruleSelection, Token name, ImplementsInterfaces ii, FieldDefinitions fds) { + this.ruleSelection = ruleSelection; + this.name = name; + this.ii = ii; + this.fds = fds; } - static ObjectTypeDefinition ConstructI(Token name, uint ii, uint fds) { - ObjectTypeDefinition ret; - ret.ruleSelection = ObjectTypeDefinitionEnum.I; - ret.name = name; - ret.iiIdx = ii; - ret.fdsIdx = fds; - return ret; + this(ObjectTypeDefinitionEnum ruleSelection, Token name, Directives dir, FieldDefinitions fds) { + this.ruleSelection = ruleSelection; + this.name = name; + this.dir = dir; + this.fds = fds; } - static ObjectTypeDefinition ConstructD(Token name, uint dir, uint fds) { - ObjectTypeDefinition ret; - ret.ruleSelection = ObjectTypeDefinitionEnum.D; - ret.name = name; - ret.dirIdx = dir; - ret.fdsIdx = fds; - return ret; + this(ObjectTypeDefinitionEnum ruleSelection, Token name, FieldDefinitions fds) { + this.ruleSelection = ruleSelection; + this.name = name; + this.fds = fds; } - static ObjectTypeDefinition ConstructF(Token name, uint fds) { - ObjectTypeDefinition ret; - ret.ruleSelection = ObjectTypeDefinitionEnum.F; - ret.name = name; - ret.fdsIdx = fds; - return ret; + void visit(Visitor vis) { + vis.accept(this); } + void visit(Visitor vis) const { + vis.accept(this); + } + + void visit(ConstVisitor vis) { + vis.accept(this); + } + + void visit(ConstVisitor vis) const { + vis.accept(this); + } } -enum FieldDefinitionsEnum : ubyte { +enum FieldDefinitionsEnum { F, FC, FNC, } -struct FieldDefinitions { +class FieldDefinitions : Node { @safe : - uint followIdx; - uint fdIdx; - FieldDefinitionsEnum ruleSelection; + FieldDefinitions follow; + FieldDefinition fd; + + this(FieldDefinitionsEnum ruleSelection, FieldDefinition fd) { + this.ruleSelection = ruleSelection; + this.fd = fd; + } + + this(FieldDefinitionsEnum ruleSelection, FieldDefinition fd, FieldDefinitions follow) { + this.ruleSelection = ruleSelection; + this.fd = fd; + this.follow = follow; + } - static FieldDefinitions ConstructF(uint fd) { - FieldDefinitions ret; - ret.ruleSelection = FieldDefinitionsEnum.F; - ret.fdIdx = fd; - return ret; + void visit(Visitor vis) { + vis.accept(this); } - static FieldDefinitions ConstructFC(uint fd, uint follow) { - FieldDefinitions ret; - ret.ruleSelection = FieldDefinitionsEnum.FC; - ret.fdIdx = fd; - ret.followIdx = follow; - return ret; + void visit(Visitor vis) const { + vis.accept(this); } - static FieldDefinitions ConstructFNC(uint fd, uint follow) { - FieldDefinitions ret; - ret.ruleSelection = FieldDefinitionsEnum.FNC; - ret.fdIdx = fd; - ret.followIdx = follow; - return ret; + void visit(ConstVisitor vis) { + vis.accept(this); } + void visit(ConstVisitor vis) const { + vis.accept(this); + } } -enum FieldDefinitionEnum : ubyte { +enum FieldDefinitionEnum { AD, A, D, @@ -1546,221 +1766,239 @@ enum FieldDefinitionEnum : ubyte { DT, } -struct FieldDefinition { +class FieldDefinition : Node { @safe : - uint desIdx; - uint argIdx; - uint typIdx; - uint dirIdx; + FieldDefinitionEnum ruleSelection; + Description des; + ArgumentsDefinition arg; + Type typ; + Directives dir; Token name; - FieldDefinitionEnum ruleSelection; + this(FieldDefinitionEnum ruleSelection, Token name, ArgumentsDefinition arg, Type typ, Directives dir) { + this.ruleSelection = ruleSelection; + this.name = name; + this.arg = arg; + this.typ = typ; + this.dir = dir; + } + + this(FieldDefinitionEnum ruleSelection, Token name, ArgumentsDefinition arg, Type typ) { + this.ruleSelection = ruleSelection; + this.name = name; + this.arg = arg; + this.typ = typ; + } + + this(FieldDefinitionEnum ruleSelection, Token name, Type typ, Directives dir) { + this.ruleSelection = ruleSelection; + this.name = name; + this.typ = typ; + this.dir = dir; + } + + this(FieldDefinitionEnum ruleSelection, Token name, Type typ) { + this.ruleSelection = ruleSelection; + this.name = name; + this.typ = typ; + } + + this(FieldDefinitionEnum ruleSelection, Description des, Token name, ArgumentsDefinition arg, Type typ, Directives dir) { + this.ruleSelection = ruleSelection; + this.des = des; + this.name = name; + this.arg = arg; + this.typ = typ; + this.dir = dir; + } - static FieldDefinition ConstructAD(Token name, uint arg, uint typ, uint dir) { - FieldDefinition ret; - ret.ruleSelection = FieldDefinitionEnum.AD; - ret.name = name; - ret.argIdx = arg; - ret.typIdx = typ; - ret.dirIdx = dir; - return ret; - } - - static FieldDefinition ConstructA(Token name, uint arg, uint typ) { - FieldDefinition ret; - ret.ruleSelection = FieldDefinitionEnum.A; - ret.name = name; - ret.argIdx = arg; - ret.typIdx = typ; - return ret; - } - - static FieldDefinition ConstructD(Token name, uint typ, uint dir) { - FieldDefinition ret; - ret.ruleSelection = FieldDefinitionEnum.D; - ret.name = name; - ret.typIdx = typ; - ret.dirIdx = dir; - return ret; - } - - static FieldDefinition ConstructT(Token name, uint typ) { - FieldDefinition ret; - ret.ruleSelection = FieldDefinitionEnum.T; - ret.name = name; - ret.typIdx = typ; - return ret; - } - - static FieldDefinition ConstructDAD(uint des, Token name, uint arg, uint typ, uint dir) { - FieldDefinition ret; - ret.ruleSelection = FieldDefinitionEnum.DAD; - ret.desIdx = des; - ret.name = name; - ret.argIdx = arg; - ret.typIdx = typ; - ret.dirIdx = dir; - return ret; - } - - static FieldDefinition ConstructDA(uint des, Token name, uint arg, uint typ) { - FieldDefinition ret; - ret.ruleSelection = FieldDefinitionEnum.DA; - ret.desIdx = des; - ret.name = name; - ret.argIdx = arg; - ret.typIdx = typ; - return ret; - } - - static FieldDefinition ConstructDD(uint des, Token name, uint typ, uint dir) { - FieldDefinition ret; - ret.ruleSelection = FieldDefinitionEnum.DD; - ret.desIdx = des; - ret.name = name; - ret.typIdx = typ; - ret.dirIdx = dir; - return ret; - } - - static FieldDefinition ConstructDT(uint des, Token name, uint typ) { - FieldDefinition ret; - ret.ruleSelection = FieldDefinitionEnum.DT; - ret.desIdx = des; - ret.name = name; - ret.typIdx = typ; - return ret; - } - -} - -enum ImplementsInterfacesEnum : ubyte { + this(FieldDefinitionEnum ruleSelection, Description des, Token name, ArgumentsDefinition arg, Type typ) { + this.ruleSelection = ruleSelection; + this.des = des; + this.name = name; + this.arg = arg; + this.typ = typ; + } + + this(FieldDefinitionEnum ruleSelection, Description des, Token name, Type typ, Directives dir) { + this.ruleSelection = ruleSelection; + this.des = des; + this.name = name; + this.typ = typ; + this.dir = dir; + } + + this(FieldDefinitionEnum ruleSelection, Description des, Token name, Type typ) { + this.ruleSelection = ruleSelection; + this.des = des; + this.name = name; + this.typ = typ; + } + + void visit(Visitor vis) { + vis.accept(this); + } + + void visit(Visitor vis) const { + vis.accept(this); + } + + void visit(ConstVisitor vis) { + vis.accept(this); + } + + void visit(ConstVisitor vis) const { + vis.accept(this); + } +} + +enum ImplementsInterfacesEnum { N, } -struct ImplementsInterfaces { +class ImplementsInterfaces : Node { @safe : - uint ntsIdx; - ImplementsInterfacesEnum ruleSelection; + NamedTypes nts; + + this(ImplementsInterfacesEnum ruleSelection, NamedTypes nts) { + this.ruleSelection = ruleSelection; + this.nts = nts; + } + + void visit(Visitor vis) { + vis.accept(this); + } + + void visit(Visitor vis) const { + vis.accept(this); + } - static ImplementsInterfaces ConstructN(uint nts) { - ImplementsInterfaces ret; - ret.ruleSelection = ImplementsInterfacesEnum.N; - ret.ntsIdx = nts; - return ret; + void visit(ConstVisitor vis) { + vis.accept(this); } + void visit(ConstVisitor vis) const { + vis.accept(this); + } } -enum NamedTypesEnum : ubyte { +enum NamedTypesEnum { N, NCS, NS, } -struct NamedTypes { +class NamedTypes : Node { @safe : - uint followIdx; + NamedTypesEnum ruleSelection; + NamedTypes follow; Token name; - NamedTypesEnum ruleSelection; + this(NamedTypesEnum ruleSelection, Token name) { + this.ruleSelection = ruleSelection; + this.name = name; + } + + this(NamedTypesEnum ruleSelection, Token name, NamedTypes follow) { + this.ruleSelection = ruleSelection; + this.name = name; + this.follow = follow; + } - static NamedTypes ConstructN(Token name) { - NamedTypes ret; - ret.ruleSelection = NamedTypesEnum.N; - ret.name = name; - return ret; + void visit(Visitor vis) { + vis.accept(this); } - static NamedTypes ConstructNCS(Token name, uint follow) { - NamedTypes ret; - ret.ruleSelection = NamedTypesEnum.NCS; - ret.name = name; - ret.followIdx = follow; - return ret; + void visit(Visitor vis) const { + vis.accept(this); } - static NamedTypes ConstructNS(Token name, uint follow) { - NamedTypes ret; - ret.ruleSelection = NamedTypesEnum.NS; - ret.name = name; - ret.followIdx = follow; - return ret; + void visit(ConstVisitor vis) { + vis.accept(this); } + void visit(ConstVisitor vis) const { + vis.accept(this); + } } -enum ArgumentsDefinitionEnum : ubyte { +enum ArgumentsDefinitionEnum { A, NA, } -struct ArgumentsDefinition { +class ArgumentsDefinition : Node { @safe : - ArgumentsDefinitionEnum ruleSelection; - static ArgumentsDefinition ConstructA() { - ArgumentsDefinition ret; - ret.ruleSelection = ArgumentsDefinitionEnum.A; + this(ArgumentsDefinitionEnum ruleSelection) { + this.ruleSelection = ruleSelection; + } - return ret; + void visit(Visitor vis) { + vis.accept(this); } - static ArgumentsDefinition ConstructNA() { - ArgumentsDefinition ret; - ret.ruleSelection = ArgumentsDefinitionEnum.NA; + void visit(Visitor vis) const { + vis.accept(this); + } - return ret; + void visit(ConstVisitor vis) { + vis.accept(this); } + void visit(ConstVisitor vis) const { + vis.accept(this); + } } -enum InputValueDefinitionsEnum : ubyte { +enum InputValueDefinitionsEnum { I, ICF, IF, } -struct InputValueDefinitions { +class InputValueDefinitions : Node { @safe : - uint followIdx; - uint ivIdx; - InputValueDefinitionsEnum ruleSelection; + InputValueDefinitions follow; + InputValueDefinition iv; + + this(InputValueDefinitionsEnum ruleSelection, InputValueDefinition iv) { + this.ruleSelection = ruleSelection; + this.iv = iv; + } + + this(InputValueDefinitionsEnum ruleSelection, InputValueDefinition iv, InputValueDefinitions follow) { + this.ruleSelection = ruleSelection; + this.iv = iv; + this.follow = follow; + } - static InputValueDefinitions ConstructI(uint iv) { - InputValueDefinitions ret; - ret.ruleSelection = InputValueDefinitionsEnum.I; - ret.ivIdx = iv; - return ret; + void visit(Visitor vis) { + vis.accept(this); } - static InputValueDefinitions ConstructICF(uint iv, uint follow) { - InputValueDefinitions ret; - ret.ruleSelection = InputValueDefinitionsEnum.ICF; - ret.ivIdx = iv; - ret.followIdx = follow; - return ret; + void visit(Visitor vis) const { + vis.accept(this); } - static InputValueDefinitions ConstructIF(uint iv, uint follow) { - InputValueDefinitions ret; - ret.ruleSelection = InputValueDefinitionsEnum.IF; - ret.ivIdx = iv; - ret.followIdx = follow; - return ret; + void visit(ConstVisitor vis) { + vis.accept(this); } + void visit(ConstVisitor vis) const { + vis.accept(this); + } } -enum InputValueDefinitionEnum : ubyte { +enum InputValueDefinitionEnum { TVD, TD, TV, @@ -1771,494 +2009,588 @@ enum InputValueDefinitionEnum : ubyte { DT, } -struct InputValueDefinition { +class InputValueDefinition : Node { @safe : - uint typeIdx; - uint desIdx; - uint dfIdx; - uint dirsIdx; + InputValueDefinitionEnum ruleSelection; + Type type; + Description des; + DefaultValue df; + Directives dirs; Token name; - InputValueDefinitionEnum ruleSelection; + this(InputValueDefinitionEnum ruleSelection, Token name, Type type, DefaultValue df, Directives dirs) { + this.ruleSelection = ruleSelection; + this.name = name; + this.type = type; + this.df = df; + this.dirs = dirs; + } - static InputValueDefinition ConstructTVD(Token name, uint type, uint df, uint dirs) { - InputValueDefinition ret; - ret.ruleSelection = InputValueDefinitionEnum.TVD; - ret.name = name; - ret.typeIdx = type; - ret.dfIdx = df; - ret.dirsIdx = dirs; - return ret; - } - - static InputValueDefinition ConstructTD(Token name, uint type, uint dirs) { - InputValueDefinition ret; - ret.ruleSelection = InputValueDefinitionEnum.TD; - ret.name = name; - ret.typeIdx = type; - ret.dirsIdx = dirs; - return ret; - } - - static InputValueDefinition ConstructTV(Token name, uint type, uint df) { - InputValueDefinition ret; - ret.ruleSelection = InputValueDefinitionEnum.TV; - ret.name = name; - ret.typeIdx = type; - ret.dfIdx = df; - return ret; - } - - static InputValueDefinition ConstructT(Token name, uint type) { - InputValueDefinition ret; - ret.ruleSelection = InputValueDefinitionEnum.T; - ret.name = name; - ret.typeIdx = type; - return ret; - } - - static InputValueDefinition ConstructDTVD(uint des, Token name, uint type, uint df, uint dirs) { - InputValueDefinition ret; - ret.ruleSelection = InputValueDefinitionEnum.DTVD; - ret.desIdx = des; - ret.name = name; - ret.typeIdx = type; - ret.dfIdx = df; - ret.dirsIdx = dirs; - return ret; - } - - static InputValueDefinition ConstructDTD(uint des, Token name, uint type, uint dirs) { - InputValueDefinition ret; - ret.ruleSelection = InputValueDefinitionEnum.DTD; - ret.desIdx = des; - ret.name = name; - ret.typeIdx = type; - ret.dirsIdx = dirs; - return ret; - } - - static InputValueDefinition ConstructDTV(uint des, Token name, uint type, uint df) { - InputValueDefinition ret; - ret.ruleSelection = InputValueDefinitionEnum.DTV; - ret.desIdx = des; - ret.name = name; - ret.typeIdx = type; - ret.dfIdx = df; - return ret; - } - - static InputValueDefinition ConstructDT(uint des, Token name, uint type) { - InputValueDefinition ret; - ret.ruleSelection = InputValueDefinitionEnum.DT; - ret.desIdx = des; - ret.name = name; - ret.typeIdx = type; - return ret; - } - -} - -enum InterfaceTypeDefinitionEnum : ubyte { + this(InputValueDefinitionEnum ruleSelection, Token name, Type type, Directives dirs) { + this.ruleSelection = ruleSelection; + this.name = name; + this.type = type; + this.dirs = dirs; + } + + this(InputValueDefinitionEnum ruleSelection, Token name, Type type, DefaultValue df) { + this.ruleSelection = ruleSelection; + this.name = name; + this.type = type; + this.df = df; + } + + this(InputValueDefinitionEnum ruleSelection, Token name, Type type) { + this.ruleSelection = ruleSelection; + this.name = name; + this.type = type; + } + + this(InputValueDefinitionEnum ruleSelection, Description des, Token name, Type type, DefaultValue df, Directives dirs) { + this.ruleSelection = ruleSelection; + this.des = des; + this.name = name; + this.type = type; + this.df = df; + this.dirs = dirs; + } + + this(InputValueDefinitionEnum ruleSelection, Description des, Token name, Type type, Directives dirs) { + this.ruleSelection = ruleSelection; + this.des = des; + this.name = name; + this.type = type; + this.dirs = dirs; + } + + this(InputValueDefinitionEnum ruleSelection, Description des, Token name, Type type, DefaultValue df) { + this.ruleSelection = ruleSelection; + this.des = des; + this.name = name; + this.type = type; + this.df = df; + } + + this(InputValueDefinitionEnum ruleSelection, Description des, Token name, Type type) { + this.ruleSelection = ruleSelection; + this.des = des; + this.name = name; + this.type = type; + } + + void visit(Visitor vis) { + vis.accept(this); + } + + void visit(Visitor vis) const { + vis.accept(this); + } + + void visit(ConstVisitor vis) { + vis.accept(this); + } + + void visit(ConstVisitor vis) const { + vis.accept(this); + } +} + +enum InterfaceTypeDefinitionEnum { NDF, NF, } -struct InterfaceTypeDefinition { +class InterfaceTypeDefinition : Node { @safe : - uint fdsIdx; - uint dirsIdx; + InterfaceTypeDefinitionEnum ruleSelection; + FieldDefinitions fds; + Directives dirs; Token name; - InterfaceTypeDefinitionEnum ruleSelection; + this(InterfaceTypeDefinitionEnum ruleSelection, Token name, Directives dirs, FieldDefinitions fds) { + this.ruleSelection = ruleSelection; + this.name = name; + this.dirs = dirs; + this.fds = fds; + } - static InterfaceTypeDefinition ConstructNDF(Token name, uint dirs, uint fds) { - InterfaceTypeDefinition ret; - ret.ruleSelection = InterfaceTypeDefinitionEnum.NDF; - ret.name = name; - ret.dirsIdx = dirs; - ret.fdsIdx = fds; - return ret; + this(InterfaceTypeDefinitionEnum ruleSelection, Token name, FieldDefinitions fds) { + this.ruleSelection = ruleSelection; + this.name = name; + this.fds = fds; } - static InterfaceTypeDefinition ConstructNF(Token name, uint fds) { - InterfaceTypeDefinition ret; - ret.ruleSelection = InterfaceTypeDefinitionEnum.NF; - ret.name = name; - ret.fdsIdx = fds; - return ret; + void visit(Visitor vis) { + vis.accept(this); } + void visit(Visitor vis) const { + vis.accept(this); + } + + void visit(ConstVisitor vis) { + vis.accept(this); + } + + void visit(ConstVisitor vis) const { + vis.accept(this); + } } -enum UnionTypeDefinitionEnum : ubyte { +enum UnionTypeDefinitionEnum { NDU, NU, } -struct UnionTypeDefinition { +class UnionTypeDefinition : Node { @safe : - uint umIdx; - uint dirsIdx; + UnionTypeDefinitionEnum ruleSelection; + UnionMembers um; + Directives dirs; Token name; - UnionTypeDefinitionEnum ruleSelection; + this(UnionTypeDefinitionEnum ruleSelection, Token name, Directives dirs, UnionMembers um) { + this.ruleSelection = ruleSelection; + this.name = name; + this.dirs = dirs; + this.um = um; + } + + this(UnionTypeDefinitionEnum ruleSelection, Token name, UnionMembers um) { + this.ruleSelection = ruleSelection; + this.name = name; + this.um = um; + } - static UnionTypeDefinition ConstructNDU(Token name, uint dirs, uint um) { - UnionTypeDefinition ret; - ret.ruleSelection = UnionTypeDefinitionEnum.NDU; - ret.name = name; - ret.dirsIdx = dirs; - ret.umIdx = um; - return ret; + void visit(Visitor vis) { + vis.accept(this); } - static UnionTypeDefinition ConstructNU(Token name, uint um) { - UnionTypeDefinition ret; - ret.ruleSelection = UnionTypeDefinitionEnum.NU; - ret.name = name; - ret.umIdx = um; - return ret; + void visit(Visitor vis) const { + vis.accept(this); } + void visit(ConstVisitor vis) { + vis.accept(this); + } + + void visit(ConstVisitor vis) const { + vis.accept(this); + } } -enum UnionMembersEnum : ubyte { +enum UnionMembersEnum { S, SPF, SF, } -struct UnionMembers { +class UnionMembers : Node { @safe : - uint followIdx; + UnionMembersEnum ruleSelection; + UnionMembers follow; Token name; - UnionMembersEnum ruleSelection; + this(UnionMembersEnum ruleSelection, Token name) { + this.ruleSelection = ruleSelection; + this.name = name; + } + + this(UnionMembersEnum ruleSelection, Token name, UnionMembers follow) { + this.ruleSelection = ruleSelection; + this.name = name; + this.follow = follow; + } - static UnionMembers ConstructS(Token name) { - UnionMembers ret; - ret.ruleSelection = UnionMembersEnum.S; - ret.name = name; - return ret; + void visit(Visitor vis) { + vis.accept(this); } - static UnionMembers ConstructSPF(Token name, uint follow) { - UnionMembers ret; - ret.ruleSelection = UnionMembersEnum.SPF; - ret.name = name; - ret.followIdx = follow; - return ret; + void visit(Visitor vis) const { + vis.accept(this); } - static UnionMembers ConstructSF(Token name, uint follow) { - UnionMembers ret; - ret.ruleSelection = UnionMembersEnum.SF; - ret.name = name; - ret.followIdx = follow; - return ret; + void visit(ConstVisitor vis) { + vis.accept(this); } + void visit(ConstVisitor vis) const { + vis.accept(this); + } } -enum EnumTypeDefinitionEnum : ubyte { +enum EnumTypeDefinitionEnum { NDE, NE, } -struct EnumTypeDefinition { +class EnumTypeDefinition : Node { @safe : - uint evdsIdx; - uint dirIdx; + EnumTypeDefinitionEnum ruleSelection; + EnumValueDefinitions evds; + Directives dir; Token name; - EnumTypeDefinitionEnum ruleSelection; + this(EnumTypeDefinitionEnum ruleSelection, Token name, Directives dir, EnumValueDefinitions evds) { + this.ruleSelection = ruleSelection; + this.name = name; + this.dir = dir; + this.evds = evds; + } + + this(EnumTypeDefinitionEnum ruleSelection, Token name, EnumValueDefinitions evds) { + this.ruleSelection = ruleSelection; + this.name = name; + this.evds = evds; + } - static EnumTypeDefinition ConstructNDE(Token name, uint dir, uint evds) { - EnumTypeDefinition ret; - ret.ruleSelection = EnumTypeDefinitionEnum.NDE; - ret.name = name; - ret.dirIdx = dir; - ret.evdsIdx = evds; - return ret; + void visit(Visitor vis) { + vis.accept(this); } - static EnumTypeDefinition ConstructNE(Token name, uint evds) { - EnumTypeDefinition ret; - ret.ruleSelection = EnumTypeDefinitionEnum.NE; - ret.name = name; - ret.evdsIdx = evds; - return ret; + void visit(Visitor vis) const { + vis.accept(this); } + void visit(ConstVisitor vis) { + vis.accept(this); + } + + void visit(ConstVisitor vis) const { + vis.accept(this); + } } -enum EnumValueDefinitionsEnum : ubyte { +enum EnumValueDefinitionsEnum { D, DCE, DE, } -struct EnumValueDefinitions { +class EnumValueDefinitions : Node { @safe : - uint evdIdx; - uint followIdx; - EnumValueDefinitionsEnum ruleSelection; + EnumValueDefinition evd; + EnumValueDefinitions follow; - static EnumValueDefinitions ConstructD(uint evd) { - EnumValueDefinitions ret; - ret.ruleSelection = EnumValueDefinitionsEnum.D; - ret.evdIdx = evd; - return ret; + this(EnumValueDefinitionsEnum ruleSelection, EnumValueDefinition evd) { + this.ruleSelection = ruleSelection; + this.evd = evd; } - static EnumValueDefinitions ConstructDCE(uint evd, uint follow) { - EnumValueDefinitions ret; - ret.ruleSelection = EnumValueDefinitionsEnum.DCE; - ret.evdIdx = evd; - ret.followIdx = follow; - return ret; + this(EnumValueDefinitionsEnum ruleSelection, EnumValueDefinition evd, EnumValueDefinitions follow) { + this.ruleSelection = ruleSelection; + this.evd = evd; + this.follow = follow; } - static EnumValueDefinitions ConstructDE(uint evd, uint follow) { - EnumValueDefinitions ret; - ret.ruleSelection = EnumValueDefinitionsEnum.DE; - ret.evdIdx = evd; - ret.followIdx = follow; - return ret; + void visit(Visitor vis) { + vis.accept(this); } + void visit(Visitor vis) const { + vis.accept(this); + } + + void visit(ConstVisitor vis) { + vis.accept(this); + } + + void visit(ConstVisitor vis) const { + vis.accept(this); + } } -enum EnumValueDefinitionEnum : ubyte { +enum EnumValueDefinitionEnum { ED, E, DED, DE, } -struct EnumValueDefinition { +class EnumValueDefinition : Node { @safe : - uint desIdx; - uint dirsIdx; + EnumValueDefinitionEnum ruleSelection; + Description des; + Directives dirs; Token name; - EnumValueDefinitionEnum ruleSelection; + this(EnumValueDefinitionEnum ruleSelection, Token name, Directives dirs) { + this.ruleSelection = ruleSelection; + this.name = name; + this.dirs = dirs; + } + + this(EnumValueDefinitionEnum ruleSelection, Token name) { + this.ruleSelection = ruleSelection; + this.name = name; + } - static EnumValueDefinition ConstructED(Token name, uint dirs) { - EnumValueDefinition ret; - ret.ruleSelection = EnumValueDefinitionEnum.ED; - ret.name = name; - ret.dirsIdx = dirs; - return ret; + this(EnumValueDefinitionEnum ruleSelection, Description des, Token name, Directives dirs) { + this.ruleSelection = ruleSelection; + this.des = des; + this.name = name; + this.dirs = dirs; } - static EnumValueDefinition ConstructE(Token name) { - EnumValueDefinition ret; - ret.ruleSelection = EnumValueDefinitionEnum.E; - ret.name = name; - return ret; + this(EnumValueDefinitionEnum ruleSelection, Description des, Token name) { + this.ruleSelection = ruleSelection; + this.des = des; + this.name = name; } - static EnumValueDefinition ConstructDED(uint des, Token name, uint dirs) { - EnumValueDefinition ret; - ret.ruleSelection = EnumValueDefinitionEnum.DED; - ret.desIdx = des; - ret.name = name; - ret.dirsIdx = dirs; - return ret; + void visit(Visitor vis) { + vis.accept(this); } - static EnumValueDefinition ConstructDE(uint des, Token name) { - EnumValueDefinition ret; - ret.ruleSelection = EnumValueDefinitionEnum.DE; - ret.desIdx = des; - ret.name = name; - return ret; + void visit(Visitor vis) const { + vis.accept(this); } + void visit(ConstVisitor vis) { + vis.accept(this); + } + + void visit(ConstVisitor vis) const { + vis.accept(this); + } } -enum InputTypeDefinitionEnum : ubyte { +enum InputTypeDefinitionEnum { NDE, NE, } -struct InputTypeDefinition { +class InputTypeDefinition : Node { @safe : - uint ivdsIdx; - uint dirIdx; + InputTypeDefinitionEnum ruleSelection; + InputValueDefinitions ivds; + Directives dir; Token name; - InputTypeDefinitionEnum ruleSelection; + this(InputTypeDefinitionEnum ruleSelection, Token name, Directives dir, InputValueDefinitions ivds) { + this.ruleSelection = ruleSelection; + this.name = name; + this.dir = dir; + this.ivds = ivds; + } + + this(InputTypeDefinitionEnum ruleSelection, Token name, InputValueDefinitions ivds) { + this.ruleSelection = ruleSelection; + this.name = name; + this.ivds = ivds; + } + + void visit(Visitor vis) { + vis.accept(this); + } - static InputTypeDefinition ConstructNDE(Token name, uint dir, uint ivds) { - InputTypeDefinition ret; - ret.ruleSelection = InputTypeDefinitionEnum.NDE; - ret.name = name; - ret.dirIdx = dir; - ret.ivdsIdx = ivds; - return ret; + void visit(Visitor vis) const { + vis.accept(this); } - static InputTypeDefinition ConstructNE(Token name, uint ivds) { - InputTypeDefinition ret; - ret.ruleSelection = InputTypeDefinitionEnum.NE; - ret.name = name; - ret.ivdsIdx = ivds; - return ret; + void visit(ConstVisitor vis) { + vis.accept(this); } + void visit(ConstVisitor vis) const { + vis.accept(this); + } } -enum TypeExtensionDefinitionEnum : ubyte { +enum TypeExtensionDefinitionEnum { O, } -struct TypeExtensionDefinition { +class TypeExtensionDefinition : Node { @safe : - uint otdIdx; - TypeExtensionDefinitionEnum ruleSelection; + ObjectTypeDefinition otd; + + this(TypeExtensionDefinitionEnum ruleSelection, ObjectTypeDefinition otd) { + this.ruleSelection = ruleSelection; + this.otd = otd; + } - static TypeExtensionDefinition ConstructO(uint otd) { - TypeExtensionDefinition ret; - ret.ruleSelection = TypeExtensionDefinitionEnum.O; - ret.otdIdx = otd; - return ret; + void visit(Visitor vis) { + vis.accept(this); } + void visit(Visitor vis) const { + vis.accept(this); + } + + void visit(ConstVisitor vis) { + vis.accept(this); + } + + void visit(ConstVisitor vis) const { + vis.accept(this); + } } -enum DirectiveDefinitionEnum : ubyte { +enum DirectiveDefinitionEnum { AD, D, } -struct DirectiveDefinition { +class DirectiveDefinition : Node { @safe : - uint dlIdx; - uint adIdx; + DirectiveDefinitionEnum ruleSelection; + DirectiveLocations dl; + ArgumentsDefinition ad; Token name; - DirectiveDefinitionEnum ruleSelection; + this(DirectiveDefinitionEnum ruleSelection, Token name, ArgumentsDefinition ad, DirectiveLocations dl) { + this.ruleSelection = ruleSelection; + this.name = name; + this.ad = ad; + this.dl = dl; + } + + this(DirectiveDefinitionEnum ruleSelection, Token name, DirectiveLocations dl) { + this.ruleSelection = ruleSelection; + this.name = name; + this.dl = dl; + } - static DirectiveDefinition ConstructAD(Token name, uint ad, uint dl) { - DirectiveDefinition ret; - ret.ruleSelection = DirectiveDefinitionEnum.AD; - ret.name = name; - ret.adIdx = ad; - ret.dlIdx = dl; - return ret; + void visit(Visitor vis) { + vis.accept(this); } - static DirectiveDefinition ConstructD(Token name, uint dl) { - DirectiveDefinition ret; - ret.ruleSelection = DirectiveDefinitionEnum.D; - ret.name = name; - ret.dlIdx = dl; - return ret; + void visit(Visitor vis) const { + vis.accept(this); } + void visit(ConstVisitor vis) { + vis.accept(this); + } + + void visit(ConstVisitor vis) const { + vis.accept(this); + } } -enum DirectiveLocationsEnum : ubyte { +enum DirectiveLocationsEnum { N, NPF, NF, } -struct DirectiveLocations { +class DirectiveLocations : Node { @safe : - uint followIdx; + DirectiveLocationsEnum ruleSelection; + DirectiveLocations follow; Token name; - DirectiveLocationsEnum ruleSelection; + this(DirectiveLocationsEnum ruleSelection, Token name) { + this.ruleSelection = ruleSelection; + this.name = name; + } + + this(DirectiveLocationsEnum ruleSelection, Token name, DirectiveLocations follow) { + this.ruleSelection = ruleSelection; + this.name = name; + this.follow = follow; + } - static DirectiveLocations ConstructN(Token name) { - DirectiveLocations ret; - ret.ruleSelection = DirectiveLocationsEnum.N; - ret.name = name; - return ret; + void visit(Visitor vis) { + vis.accept(this); } - static DirectiveLocations ConstructNPF(Token name, uint follow) { - DirectiveLocations ret; - ret.ruleSelection = DirectiveLocationsEnum.NPF; - ret.name = name; - ret.followIdx = follow; - return ret; + void visit(Visitor vis) const { + vis.accept(this); } - static DirectiveLocations ConstructNF(Token name, uint follow) { - DirectiveLocations ret; - ret.ruleSelection = DirectiveLocationsEnum.NF; - ret.name = name; - ret.followIdx = follow; - return ret; + void visit(ConstVisitor vis) { + vis.accept(this); } + void visit(ConstVisitor vis) const { + vis.accept(this); + } } -enum InputObjectTypeDefinitionEnum : ubyte { +enum InputObjectTypeDefinitionEnum { NDI, NI, } -struct InputObjectTypeDefinition { +class InputObjectTypeDefinition : Node { @safe : - uint dirsIdx; + InputObjectTypeDefinitionEnum ruleSelection; + Directives dirs; Token name; - InputObjectTypeDefinitionEnum ruleSelection; + this(InputObjectTypeDefinitionEnum ruleSelection, Token name, Directives dirs) { + this.ruleSelection = ruleSelection; + this.name = name; + this.dirs = dirs; + } + + this(InputObjectTypeDefinitionEnum ruleSelection, Token name) { + this.ruleSelection = ruleSelection; + this.name = name; + } - static InputObjectTypeDefinition ConstructNDI(Token name, uint dirs) { - InputObjectTypeDefinition ret; - ret.ruleSelection = InputObjectTypeDefinitionEnum.NDI; - ret.name = name; - ret.dirsIdx = dirs; - return ret; + void visit(Visitor vis) { + vis.accept(this); } - static InputObjectTypeDefinition ConstructNI(Token name) { - InputObjectTypeDefinition ret; - ret.ruleSelection = InputObjectTypeDefinitionEnum.NI; - ret.name = name; - return ret; + void visit(Visitor vis) const { + vis.accept(this); } + void visit(ConstVisitor vis) { + vis.accept(this); + } + + void visit(ConstVisitor vis) const { + vis.accept(this); + } } -enum DescriptionEnum : ubyte { +enum DescriptionEnum { S, } -struct Description { +class Description : Node { @safe : + DescriptionEnum ruleSelection; Token tok; - DescriptionEnum ruleSelection; + this(DescriptionEnum ruleSelection, Token tok) { + this.ruleSelection = ruleSelection; + this.tok = tok; + } + + void visit(Visitor vis) { + vis.accept(this); + } - static Description ConstructS(Token tok) { - Description ret; - ret.ruleSelection = DescriptionEnum.S; - ret.tok = tok; - return ret; + void visit(Visitor vis) const { + vis.accept(this); } + void visit(ConstVisitor vis) { + vis.accept(this); + } + + void visit(ConstVisitor vis) const { + vis.accept(this); + } } diff --git a/source/graphql/astselector.d b/source/graphql/astselector.d index 585e0c86..37b0f02a 100644 --- a/source/graphql/astselector.d +++ b/source/graphql/astselector.d @@ -13,7 +13,6 @@ this module allows to do that. @safe: -/+ const(T) astSelect(T,S)(const(S) input, string path) { auto astsel = new AstSelector(path); static if(is(S == Document)) { @@ -374,4 +373,3 @@ mutation a { assert(bar is null || bar !is foo); } } -+/ diff --git a/source/graphql/builder.d b/source/graphql/builder.d index c8b27c6c..b0cea872 100644 --- a/source/graphql/builder.d +++ b/source/graphql/builder.d @@ -1,7 +1,5 @@ module graphql.builder; -__EOF__ - version(LDC) { import std.experimental.logger : logf; } else { diff --git a/source/graphql/directives.d b/source/graphql/directives.d index 7e63fd36..309176dd 100644 --- a/source/graphql/directives.d +++ b/source/graphql/directives.d @@ -1,7 +1,5 @@ module graphql.directives; -__EOF__ - import std.format : format; import vibe.data.json; diff --git a/source/graphql/graphql.d b/source/graphql/graphql.d index 5597fd1c..a8f78f3e 100644 --- a/source/graphql/graphql.d +++ b/source/graphql/graphql.d @@ -1,7 +1,5 @@ module graphql.graphql; -__EOF__ - import std.array : array, front, empty; import std.stdio; version(LDC) { diff --git a/source/graphql/helper.d b/source/graphql/helper.d index 2d5f899b..1c6dabbb 100644 --- a/source/graphql/helper.d +++ b/source/graphql/helper.d @@ -612,7 +612,6 @@ unittest { assert(k["foo"].jsonTo!FooEn() == FooEn.b); } -/+ const(Document) lexAndParse(string s) { import graphql.lexer; import graphql.parser; @@ -621,7 +620,6 @@ const(Document) lexAndParse(string s) { const(Document) doc = p.parseDocument(); return doc; } -+/ struct StringTypeStrip { string input; diff --git a/source/graphql/parser.d b/source/graphql/parser.d index dae8c843..6b5b1ae3 100644 --- a/source/graphql/parser.d +++ b/source/graphql/parser.d @@ -1,9 +1,7 @@ module graphql.parser; -import std.array : appender; -import std.format : formattedWrite; +import std.typecons : RefCounted, refCounted; import std.format : format; - import graphql.ast; import graphql.tokenmodule; @@ -14,63 +12,10 @@ import graphql.exception; struct Parser { @safe : - Document[] documents; - Definitions[] definitionss; - Definition[] definitions; - OperationDefinition[] operationDefinitions; - SelectionSet[] selectionSets; - OperationType[] operationTypes; - Selections[] selectionss; - Selection[] selections; - FragmentSpread[] fragmentSpreads; - InlineFragment[] inlineFragments; - Field[] fields; - FieldName[] fieldNames; - Arguments[] argumentss; - ArgumentList[] argumentLists; - Argument[] arguments; - FragmentDefinition[] fragmentDefinitions; - Directives[] directivess; - Directive[] directives; - VariableDefinitions[] variableDefinitionss; - VariableDefinitionList[] variableDefinitionLists; - VariableDefinition[] variableDefinitions; - Variable[] variables; - DefaultValue[] defaultValues; - ValueOrVariable[] valueOrVariables; - Value[] values; - Type[] types; - ListType[] listTypes; - Values[] valuess; - Array[] arrays; - ObjectValues[] objectValuess; - ObjectType[] objectTypes; - TypeSystemDefinition[] typeSystemDefinitions; - TypeDefinition[] typeDefinitions; - SchemaDefinition[] schemaDefinitions; - OperationTypeDefinitions[] operationTypeDefinitionss; - OperationTypeDefinition[] operationTypeDefinitions; - ScalarTypeDefinition[] scalarTypeDefinitions; - ObjectTypeDefinition[] objectTypeDefinitions; - FieldDefinitions[] fieldDefinitionss; - FieldDefinition[] fieldDefinitions; - ImplementsInterfaces[] implementsInterfacess; - NamedTypes[] namedTypess; - ArgumentsDefinition[] argumentsDefinitions; - InputValueDefinitions[] inputValueDefinitionss; - InputValueDefinition[] inputValueDefinitions; - InterfaceTypeDefinition[] interfaceTypeDefinitions; - UnionTypeDefinition[] unionTypeDefinitions; - UnionMembers[] unionMemberss; - EnumTypeDefinition[] enumTypeDefinitions; - EnumValueDefinitions[] enumValueDefinitionss; - EnumValueDefinition[] enumValueDefinitions; - InputTypeDefinition[] inputTypeDefinitions; - TypeExtensionDefinition[] typeExtensionDefinitions; - DirectiveDefinition[] directiveDefinitions; - DirectiveLocations[] directiveLocationss; - InputObjectTypeDefinition[] inputObjectTypeDefinitions; - Description[] descriptions; + import std.array : appender; + + import std.format : formattedWrite; + Lexer lex; this(Lexer lex) { @@ -81,7 +26,7 @@ struct Parser { return this.firstDefinitions(); } - uint parseDocument() { + Document parseDocument() { try { return this.parseDocumentImpl(); } catch(ParseException e) { @@ -92,14 +37,15 @@ struct Parser { } } - uint parseDocumentImpl() { + Document parseDocumentImpl() { string[] subRules; + subRules = ["Defi"]; if(this.firstDefinitions()) { - uint defs = this.parseDefinitions(); - - this.documents ~= Document.ConstructDefi(defs); - return cast(uint)(this.documents.length - 1); + Definitions defs = this.parseDefinitions(); + return new Document(DocumentEnum.Defi + , defs + ); } auto app = appender!string(); formattedWrite(app, @@ -118,7 +64,7 @@ struct Parser { return this.firstDefinition(); } - uint parseDefinitions() { + Definitions parseDefinitions() { try { return this.parseDefinitionsImpl(); } catch(ParseException e) { @@ -129,20 +75,23 @@ struct Parser { } } - uint parseDefinitionsImpl() { + Definitions parseDefinitionsImpl() { string[] subRules; + subRules = ["Def", "Defs"]; if(this.firstDefinition()) { - uint def = this.parseDefinition(); + Definition def = this.parseDefinition(); + subRules = ["Defs"]; if(this.firstDefinitions()) { - uint follow = this.parseDefinitions(); - - this.definitionss ~= Definitions.ConstructDefs(def, follow); - return cast(uint)(this.definitionss.length - 1); + Definitions follow = this.parseDefinitions(); + return new Definitions(DefinitionsEnum.Defs + , def + , follow + ); } - this.definitionss ~= Definitions.ConstructDef(def); - return cast(uint)(this.definitionss.length - 1); - + return new Definitions(DefinitionsEnum.Def + , def + ); } auto app = appender!string(); formattedWrite(app, @@ -163,7 +112,7 @@ struct Parser { || this.firstTypeSystemDefinition(); } - uint parseDefinition() { + Definition parseDefinition() { try { return this.parseDefinitionImpl(); } catch(ParseException e) { @@ -174,26 +123,27 @@ struct Parser { } } - uint parseDefinitionImpl() { + Definition parseDefinitionImpl() { string[] subRules; + subRules = ["O"]; if(this.firstOperationDefinition()) { - uint op = this.parseOperationDefinition(); - - this.definitions ~= Definition.ConstructO(op); - return cast(uint)(this.definitions.length - 1); + OperationDefinition op = this.parseOperationDefinition(); + return new Definition(DefinitionEnum.O + , op + ); } else if(this.firstFragmentDefinition()) { - uint frag = this.parseFragmentDefinition(); - - this.definitions ~= Definition.ConstructF(frag); - return cast(uint)(this.definitions.length - 1); + FragmentDefinition frag = this.parseFragmentDefinition(); + return new Definition(DefinitionEnum.F + , frag + ); } else if(this.firstTypeSystemDefinition()) { - uint type = this.parseTypeSystemDefinition(); - - this.definitions ~= Definition.ConstructT(type); - return cast(uint)(this.definitions.length - 1); + TypeSystemDefinition type = this.parseTypeSystemDefinition(); + return new Definition(DefinitionEnum.T + , type + ); } auto app = appender!string(); formattedWrite(app, @@ -213,7 +163,7 @@ struct Parser { || this.firstOperationType(); } - uint parseOperationDefinition() { + OperationDefinition parseOperationDefinition() { try { return this.parseOperationDefinitionImpl(); } catch(ParseException e) { @@ -224,29 +174,38 @@ struct Parser { } } - uint parseOperationDefinitionImpl() { + OperationDefinition parseOperationDefinitionImpl() { string[] subRules; + subRules = ["SelSet"]; if(this.firstSelectionSet()) { - uint ss = this.parseSelectionSet(); - - this.operationDefinitions ~= OperationDefinition.ConstructSelSet(ss); - return cast(uint)(this.operationDefinitions.length - 1); + SelectionSet ss = this.parseSelectionSet(); + return new OperationDefinition(OperationDefinitionEnum.SelSet + , ss + ); } else if(this.firstOperationType()) { - uint ot = this.parseOperationType(); + OperationType ot = this.parseOperationType(); + subRules = ["OT_N", "OT_N_D", "OT_N_V", "OT_N_VD"]; if(this.lex.front.type == TokenType.name) { Token name = this.lex.front; this.lex.popFront(); + subRules = ["OT_N_V", "OT_N_VD"]; if(this.firstVariableDefinitions()) { - uint vd = this.parseVariableDefinitions(); + VariableDefinitions vd = this.parseVariableDefinitions(); + subRules = ["OT_N_VD"]; if(this.firstDirectives()) { - uint d = this.parseDirectives(); + Directives d = this.parseDirectives(); + subRules = ["OT_N_VD"]; if(this.firstSelectionSet()) { - uint ss = this.parseSelectionSet(); - - this.operationDefinitions ~= OperationDefinition.ConstructOT_N_VD(ot, name, vd, d, ss); - return cast(uint)(this.operationDefinitions.length - 1); - + SelectionSet ss = this.parseSelectionSet(); + + return new OperationDefinition(OperationDefinitionEnum.OT_N_VD + , ot + , name + , vd + , d + , ss + ); } auto app = appender!string(); formattedWrite(app, @@ -260,11 +219,14 @@ struct Parser { ); } else if(this.firstSelectionSet()) { - uint ss = this.parseSelectionSet(); - - this.operationDefinitions ~= OperationDefinition.ConstructOT_N_V(ot, name, vd, ss); - return cast(uint)(this.operationDefinitions.length - 1); + SelectionSet ss = this.parseSelectionSet(); + return new OperationDefinition(OperationDefinitionEnum.OT_N_V + , ot + , name + , vd + , ss + ); } auto app = appender!string(); formattedWrite(app, @@ -278,13 +240,17 @@ struct Parser { ); } else if(this.firstDirectives()) { - uint d = this.parseDirectives(); + Directives d = this.parseDirectives(); + subRules = ["OT_N_D"]; if(this.firstSelectionSet()) { - uint ss = this.parseSelectionSet(); - - this.operationDefinitions ~= OperationDefinition.ConstructOT_N_D(ot, name, d, ss); - return cast(uint)(this.operationDefinitions.length - 1); + SelectionSet ss = this.parseSelectionSet(); + return new OperationDefinition(OperationDefinitionEnum.OT_N_D + , ot + , name + , d + , ss + ); } auto app = appender!string(); formattedWrite(app, @@ -298,11 +264,13 @@ struct Parser { ); } else if(this.firstSelectionSet()) { - uint ss = this.parseSelectionSet(); - - this.operationDefinitions ~= OperationDefinition.ConstructOT_N(ot, name, ss); - return cast(uint)(this.operationDefinitions.length - 1); + SelectionSet ss = this.parseSelectionSet(); + return new OperationDefinition(OperationDefinitionEnum.OT_N + , ot + , name + , ss + ); } auto app = appender!string(); formattedWrite(app, @@ -316,15 +284,20 @@ struct Parser { ); } else if(this.firstVariableDefinitions()) { - uint vd = this.parseVariableDefinitions(); + VariableDefinitions vd = this.parseVariableDefinitions(); + subRules = ["OT_VD"]; if(this.firstDirectives()) { - uint d = this.parseDirectives(); + Directives d = this.parseDirectives(); + subRules = ["OT_VD"]; if(this.firstSelectionSet()) { - uint ss = this.parseSelectionSet(); - - this.operationDefinitions ~= OperationDefinition.ConstructOT_VD(ot, vd, d, ss); - return cast(uint)(this.operationDefinitions.length - 1); + SelectionSet ss = this.parseSelectionSet(); + return new OperationDefinition(OperationDefinitionEnum.OT_VD + , ot + , vd + , d + , ss + ); } auto app = appender!string(); formattedWrite(app, @@ -338,11 +311,13 @@ struct Parser { ); } else if(this.firstSelectionSet()) { - uint ss = this.parseSelectionSet(); - - this.operationDefinitions ~= OperationDefinition.ConstructOT_V(ot, vd, ss); - return cast(uint)(this.operationDefinitions.length - 1); + SelectionSet ss = this.parseSelectionSet(); + return new OperationDefinition(OperationDefinitionEnum.OT_V + , ot + , vd + , ss + ); } auto app = appender!string(); formattedWrite(app, @@ -356,13 +331,16 @@ struct Parser { ); } else if(this.firstDirectives()) { - uint d = this.parseDirectives(); + Directives d = this.parseDirectives(); + subRules = ["OT_D"]; if(this.firstSelectionSet()) { - uint ss = this.parseSelectionSet(); - - this.operationDefinitions ~= OperationDefinition.ConstructOT_D(ot, d, ss); - return cast(uint)(this.operationDefinitions.length - 1); + SelectionSet ss = this.parseSelectionSet(); + return new OperationDefinition(OperationDefinitionEnum.OT_D + , ot + , d + , ss + ); } auto app = appender!string(); formattedWrite(app, @@ -376,11 +354,12 @@ struct Parser { ); } else if(this.firstSelectionSet()) { - uint ss = this.parseSelectionSet(); - - this.operationDefinitions ~= OperationDefinition.ConstructOT(ot, ss); - return cast(uint)(this.operationDefinitions.length - 1); + SelectionSet ss = this.parseSelectionSet(); + return new OperationDefinition(OperationDefinitionEnum.OT + , ot + , ss + ); } auto app = appender!string(); formattedWrite(app, @@ -411,7 +390,7 @@ struct Parser { return this.lex.front.type == TokenType.lcurly; } - uint parseSelectionSet() { + SelectionSet parseSelectionSet() { try { return this.parseSelectionSetImpl(); } catch(ParseException e) { @@ -422,18 +401,21 @@ struct Parser { } } - uint parseSelectionSetImpl() { + SelectionSet parseSelectionSetImpl() { string[] subRules; + subRules = ["SS"]; if(this.lex.front.type == TokenType.lcurly) { this.lex.popFront(); + subRules = ["SS"]; if(this.firstSelections()) { - uint sel = this.parseSelections(); + Selections sel = this.parseSelections(); + subRules = ["SS"]; if(this.lex.front.type == TokenType.rcurly) { this.lex.popFront(); - this.selectionSets ~= SelectionSet.ConstructSS(sel); - return cast(uint)(this.selectionSets.length - 1); - + return new SelectionSet(SelectionSetEnum.SS + , sel + ); } auto app = appender!string(); formattedWrite(app, @@ -478,7 +460,7 @@ struct Parser { || this.lex.front.type == TokenType.subscription; } - uint parseOperationType() { + OperationType parseOperationType() { try { return this.parseOperationTypeImpl(); } catch(ParseException e) { @@ -489,29 +471,30 @@ struct Parser { } } - uint parseOperationTypeImpl() { + OperationType parseOperationTypeImpl() { string[] subRules; + subRules = ["Query"]; if(this.lex.front.type == TokenType.query) { Token tok = this.lex.front; this.lex.popFront(); - this.operationTypes ~= OperationType.ConstructQuery(tok); - return cast(uint)(this.operationTypes.length - 1); - + return new OperationType(OperationTypeEnum.Query + , tok + ); } else if(this.lex.front.type == TokenType.mutation) { Token tok = this.lex.front; this.lex.popFront(); - this.operationTypes ~= OperationType.ConstructMutation(tok); - return cast(uint)(this.operationTypes.length - 1); - + return new OperationType(OperationTypeEnum.Mutation + , tok + ); } else if(this.lex.front.type == TokenType.subscription) { Token tok = this.lex.front; this.lex.popFront(); - this.operationTypes ~= OperationType.ConstructSub(tok); - return cast(uint)(this.operationTypes.length - 1); - + return new OperationType(OperationTypeEnum.Sub + , tok + ); } auto app = appender!string(); formattedWrite(app, @@ -530,7 +513,7 @@ struct Parser { return this.firstSelection(); } - uint parseSelections() { + Selections parseSelections() { try { return this.parseSelectionsImpl(); } catch(ParseException e) { @@ -541,24 +524,29 @@ struct Parser { } } - uint parseSelectionsImpl() { + Selections parseSelectionsImpl() { string[] subRules; + subRules = ["Sel", "Sels", "Selsc"]; if(this.firstSelection()) { - uint sel = this.parseSelection(); + Selection sel = this.parseSelection(); + subRules = ["Sels"]; if(this.firstSelections()) { - uint follow = this.parseSelections(); - - this.selectionss ~= Selections.ConstructSels(sel, follow); - return cast(uint)(this.selectionss.length - 1); + Selections follow = this.parseSelections(); + return new Selections(SelectionsEnum.Sels + , sel + , follow + ); } else if(this.lex.front.type == TokenType.comma) { this.lex.popFront(); + subRules = ["Selsc"]; if(this.firstSelections()) { - uint follow = this.parseSelections(); - - this.selectionss ~= Selections.ConstructSelsc(sel, follow); - return cast(uint)(this.selectionss.length - 1); + Selections follow = this.parseSelections(); + return new Selections(SelectionsEnum.Selsc + , sel + , follow + ); } auto app = appender!string(); formattedWrite(app, @@ -572,9 +560,9 @@ struct Parser { ); } - this.selectionss ~= Selections.ConstructSel(sel); - return cast(uint)(this.selectionss.length - 1); - + return new Selections(SelectionsEnum.Sel + , sel + ); } auto app = appender!string(); formattedWrite(app, @@ -594,7 +582,7 @@ struct Parser { || this.lex.front.type == TokenType.dots; } - uint parseSelection() { + Selection parseSelection() { try { return this.parseSelectionImpl(); } catch(ParseException e) { @@ -605,28 +593,30 @@ struct Parser { } } - uint parseSelectionImpl() { + Selection parseSelectionImpl() { string[] subRules; + subRules = ["Field"]; if(this.firstField()) { - uint field = this.parseField(); - - this.selections ~= Selection.ConstructField(field); - return cast(uint)(this.selections.length - 1); + Field field = this.parseField(); + return new Selection(SelectionEnum.Field + , field + ); } else if(this.lex.front.type == TokenType.dots) { this.lex.popFront(); + subRules = ["Spread"]; if(this.firstFragmentSpread()) { - uint frag = this.parseFragmentSpread(); - - this.selections ~= Selection.ConstructSpread(frag); - return cast(uint)(this.selections.length - 1); + FragmentSpread frag = this.parseFragmentSpread(); + return new Selection(SelectionEnum.Spread + , frag + ); } else if(this.firstInlineFragment()) { - uint ifrag = this.parseInlineFragment(); - - this.selections ~= Selection.ConstructIFrag(ifrag); - return cast(uint)(this.selections.length - 1); + InlineFragment ifrag = this.parseInlineFragment(); + return new Selection(SelectionEnum.IFrag + , ifrag + ); } auto app = appender!string(); formattedWrite(app, @@ -657,7 +647,7 @@ struct Parser { return this.lex.front.type == TokenType.name; } - uint parseFragmentSpread() { + FragmentSpread parseFragmentSpread() { try { return this.parseFragmentSpreadImpl(); } catch(ParseException e) { @@ -668,21 +658,24 @@ struct Parser { } } - uint parseFragmentSpreadImpl() { + FragmentSpread parseFragmentSpreadImpl() { string[] subRules; + subRules = ["F", "FD"]; if(this.lex.front.type == TokenType.name) { Token name = this.lex.front; this.lex.popFront(); + subRules = ["FD"]; if(this.firstDirectives()) { - uint dirs = this.parseDirectives(); - - this.fragmentSpreads ~= FragmentSpread.ConstructFD(name, dirs); - return cast(uint)(this.fragmentSpreads.length - 1); + Directives dirs = this.parseDirectives(); + return new FragmentSpread(FragmentSpreadEnum.FD + , name + , dirs + ); } - this.fragmentSpreads ~= FragmentSpread.ConstructF(name); - return cast(uint)(this.fragmentSpreads.length - 1); - + return new FragmentSpread(FragmentSpreadEnum.F + , name + ); } auto app = appender!string(); formattedWrite(app, @@ -703,7 +696,7 @@ struct Parser { || this.firstSelectionSet(); } - uint parseInlineFragment() { + InlineFragment parseInlineFragment() { try { return this.parseInlineFragmentImpl(); } catch(ParseException e) { @@ -714,21 +707,27 @@ struct Parser { } } - uint parseInlineFragmentImpl() { + InlineFragment parseInlineFragmentImpl() { string[] subRules; + subRules = ["TDS", "TS"]; if(this.lex.front.type == TokenType.on_) { this.lex.popFront(); + subRules = ["TDS", "TS"]; if(this.lex.front.type == TokenType.name) { Token tc = this.lex.front; this.lex.popFront(); + subRules = ["TDS"]; if(this.firstDirectives()) { - uint dirs = this.parseDirectives(); + Directives dirs = this.parseDirectives(); + subRules = ["TDS"]; if(this.firstSelectionSet()) { - uint ss = this.parseSelectionSet(); - - this.inlineFragments ~= InlineFragment.ConstructTDS(tc, dirs, ss); - return cast(uint)(this.inlineFragments.length - 1); + SelectionSet ss = this.parseSelectionSet(); + return new InlineFragment(InlineFragmentEnum.TDS + , tc + , dirs + , ss + ); } auto app = appender!string(); formattedWrite(app, @@ -742,11 +741,12 @@ struct Parser { ); } else if(this.firstSelectionSet()) { - uint ss = this.parseSelectionSet(); - - this.inlineFragments ~= InlineFragment.ConstructTS(tc, ss); - return cast(uint)(this.inlineFragments.length - 1); + SelectionSet ss = this.parseSelectionSet(); + return new InlineFragment(InlineFragmentEnum.TS + , tc + , ss + ); } auto app = appender!string(); formattedWrite(app, @@ -772,13 +772,15 @@ struct Parser { ); } else if(this.firstDirectives()) { - uint dirs = this.parseDirectives(); + Directives dirs = this.parseDirectives(); + subRules = ["DS"]; if(this.firstSelectionSet()) { - uint ss = this.parseSelectionSet(); - - this.inlineFragments ~= InlineFragment.ConstructDS(dirs, ss); - return cast(uint)(this.inlineFragments.length - 1); + SelectionSet ss = this.parseSelectionSet(); + return new InlineFragment(InlineFragmentEnum.DS + , dirs + , ss + ); } auto app = appender!string(); formattedWrite(app, @@ -792,11 +794,11 @@ struct Parser { ); } else if(this.firstSelectionSet()) { - uint ss = this.parseSelectionSet(); - - this.inlineFragments ~= InlineFragment.ConstructS(ss); - return cast(uint)(this.inlineFragments.length - 1); + SelectionSet ss = this.parseSelectionSet(); + return new InlineFragment(InlineFragmentEnum.S + , ss + ); } auto app = appender!string(); formattedWrite(app, @@ -815,7 +817,7 @@ struct Parser { return this.firstFieldName(); } - uint parseField() { + Field parseField() { try { return this.parseFieldImpl(); } catch(ParseException e) { @@ -826,56 +828,73 @@ struct Parser { } } - uint parseFieldImpl() { + Field parseFieldImpl() { string[] subRules; + subRules = ["F", "FA", "FAD", "FADS", "FAS", "FD", "FDS", "FS"]; if(this.firstFieldName()) { - uint name = this.parseFieldName(); + FieldName name = this.parseFieldName(); + subRules = ["FA", "FAD", "FADS", "FAS"]; if(this.firstArguments()) { - uint args = this.parseArguments(); + Arguments args = this.parseArguments(); + subRules = ["FAD", "FADS"]; if(this.firstDirectives()) { - uint dirs = this.parseDirectives(); + Directives dirs = this.parseDirectives(); + subRules = ["FADS"]; if(this.firstSelectionSet()) { - uint ss = this.parseSelectionSet(); - - this.fields ~= Field.ConstructFADS(name, args, dirs, ss); - return cast(uint)(this.fields.length - 1); + SelectionSet ss = this.parseSelectionSet(); + return new Field(FieldEnum.FADS + , name + , args + , dirs + , ss + ); } - this.fields ~= Field.ConstructFAD(name, args, dirs); - return cast(uint)(this.fields.length - 1); - + return new Field(FieldEnum.FAD + , name + , args + , dirs + ); } else if(this.firstSelectionSet()) { - uint ss = this.parseSelectionSet(); - - this.fields ~= Field.ConstructFAS(name, args, ss); - return cast(uint)(this.fields.length - 1); + SelectionSet ss = this.parseSelectionSet(); + return new Field(FieldEnum.FAS + , name + , args + , ss + ); } - this.fields ~= Field.ConstructFA(name, args); - return cast(uint)(this.fields.length - 1); - + return new Field(FieldEnum.FA + , name + , args + ); } else if(this.firstDirectives()) { - uint dirs = this.parseDirectives(); + Directives dirs = this.parseDirectives(); + subRules = ["FDS"]; if(this.firstSelectionSet()) { - uint ss = this.parseSelectionSet(); - - this.fields ~= Field.ConstructFDS(name, dirs, ss); - return cast(uint)(this.fields.length - 1); + SelectionSet ss = this.parseSelectionSet(); + return new Field(FieldEnum.FDS + , name + , dirs + , ss + ); } - this.fields ~= Field.ConstructFD(name, dirs); - return cast(uint)(this.fields.length - 1); - + return new Field(FieldEnum.FD + , name + , dirs + ); } else if(this.firstSelectionSet()) { - uint ss = this.parseSelectionSet(); - - this.fields ~= Field.ConstructFS(name, ss); - return cast(uint)(this.fields.length - 1); + SelectionSet ss = this.parseSelectionSet(); + return new Field(FieldEnum.FS + , name + , ss + ); } - this.fields ~= Field.ConstructF(name); - return cast(uint)(this.fields.length - 1); - + return new Field(FieldEnum.F + , name + ); } auto app = appender!string(); formattedWrite(app, @@ -894,7 +913,7 @@ struct Parser { return this.lex.front.type == TokenType.name; } - uint parseFieldName() { + FieldName parseFieldName() { try { return this.parseFieldNameImpl(); } catch(ParseException e) { @@ -905,20 +924,24 @@ struct Parser { } } - uint parseFieldNameImpl() { + FieldName parseFieldNameImpl() { string[] subRules; + subRules = ["A", "N"]; if(this.lex.front.type == TokenType.name) { Token name = this.lex.front; this.lex.popFront(); + subRules = ["A"]; if(this.lex.front.type == TokenType.colon) { this.lex.popFront(); + subRules = ["A"]; if(this.lex.front.type == TokenType.name) { Token aka = this.lex.front; this.lex.popFront(); - this.fieldNames ~= FieldName.ConstructA(name, aka); - return cast(uint)(this.fieldNames.length - 1); - + return new FieldName(FieldNameEnum.A + , name + , aka + ); } auto app = appender!string(); formattedWrite(app, @@ -932,9 +955,9 @@ struct Parser { ); } - this.fieldNames ~= FieldName.ConstructN(name); - return cast(uint)(this.fieldNames.length - 1); - + return new FieldName(FieldNameEnum.N + , name + ); } auto app = appender!string(); formattedWrite(app, @@ -953,7 +976,7 @@ struct Parser { return this.lex.front.type == TokenType.lparen; } - uint parseArguments() { + Arguments parseArguments() { try { return this.parseArgumentsImpl(); } catch(ParseException e) { @@ -964,18 +987,21 @@ struct Parser { } } - uint parseArgumentsImpl() { + Arguments parseArgumentsImpl() { string[] subRules; + subRules = ["Empty", "List"]; if(this.lex.front.type == TokenType.lparen) { this.lex.popFront(); + subRules = ["List"]; if(this.firstArgumentList()) { - uint arg = this.parseArgumentList(); + ArgumentList arg = this.parseArgumentList(); + subRules = ["List"]; if(this.lex.front.type == TokenType.rparen) { this.lex.popFront(); - this.argumentss ~= Arguments.ConstructList(arg); - return cast(uint)(this.argumentss.length - 1); - + return new Arguments(ArgumentsEnum.List + , arg + ); } auto app = appender!string(); formattedWrite(app, @@ -991,9 +1017,8 @@ struct Parser { } else if(this.lex.front.type == TokenType.rparen) { this.lex.popFront(); - this.argumentss ~= Arguments.ConstructEmpty(); - return cast(uint)(this.argumentss.length - 1); - + return new Arguments(ArgumentsEnum.Empty + ); } auto app = appender!string(); formattedWrite(app, @@ -1024,7 +1049,7 @@ struct Parser { return this.firstArgument(); } - uint parseArgumentList() { + ArgumentList parseArgumentList() { try { return this.parseArgumentListImpl(); } catch(ParseException e) { @@ -1035,18 +1060,22 @@ struct Parser { } } - uint parseArgumentListImpl() { + ArgumentList parseArgumentListImpl() { string[] subRules; + subRules = ["A", "ACS", "AS"]; if(this.firstArgument()) { - uint arg = this.parseArgument(); + Argument arg = this.parseArgument(); + subRules = ["ACS"]; if(this.lex.front.type == TokenType.comma) { this.lex.popFront(); + subRules = ["ACS"]; if(this.firstArgumentList()) { - uint follow = this.parseArgumentList(); - - this.argumentLists ~= ArgumentList.ConstructACS(arg, follow); - return cast(uint)(this.argumentLists.length - 1); + ArgumentList follow = this.parseArgumentList(); + return new ArgumentList(ArgumentListEnum.ACS + , arg + , follow + ); } auto app = appender!string(); formattedWrite(app, @@ -1060,15 +1089,16 @@ struct Parser { ); } else if(this.firstArgumentList()) { - uint follow = this.parseArgumentList(); - - this.argumentLists ~= ArgumentList.ConstructAS(arg, follow); - return cast(uint)(this.argumentLists.length - 1); + ArgumentList follow = this.parseArgumentList(); + return new ArgumentList(ArgumentListEnum.AS + , arg + , follow + ); } - this.argumentLists ~= ArgumentList.ConstructA(arg); - return cast(uint)(this.argumentLists.length - 1); - + return new ArgumentList(ArgumentListEnum.A + , arg + ); } auto app = appender!string(); formattedWrite(app, @@ -1087,7 +1117,7 @@ struct Parser { return this.lex.front.type == TokenType.name; } - uint parseArgument() { + Argument parseArgument() { try { return this.parseArgumentImpl(); } catch(ParseException e) { @@ -1098,19 +1128,23 @@ struct Parser { } } - uint parseArgumentImpl() { + Argument parseArgumentImpl() { string[] subRules; + subRules = ["Name"]; if(this.lex.front.type == TokenType.name) { Token name = this.lex.front; this.lex.popFront(); + subRules = ["Name"]; if(this.lex.front.type == TokenType.colon) { this.lex.popFront(); + subRules = ["Name"]; if(this.firstValueOrVariable()) { - uint vv = this.parseValueOrVariable(); - - this.arguments ~= Argument.ConstructName(name, vv); - return cast(uint)(this.arguments.length - 1); + ValueOrVariable vv = this.parseValueOrVariable(); + return new Argument(ArgumentEnum.Name + , name + , vv + ); } auto app = appender!string(); formattedWrite(app, @@ -1153,7 +1187,7 @@ struct Parser { return this.lex.front.type == TokenType.fragment; } - uint parseFragmentDefinition() { + FragmentDefinition parseFragmentDefinition() { try { return this.parseFragmentDefinitionImpl(); } catch(ParseException e) { @@ -1164,26 +1198,35 @@ struct Parser { } } - uint parseFragmentDefinitionImpl() { + FragmentDefinition parseFragmentDefinitionImpl() { string[] subRules; + subRules = ["FTDS", "FTS"]; if(this.lex.front.type == TokenType.fragment) { this.lex.popFront(); + subRules = ["FTDS", "FTS"]; if(this.lex.front.type == TokenType.name) { Token name = this.lex.front; this.lex.popFront(); + subRules = ["FTDS", "FTS"]; if(this.lex.front.type == TokenType.on_) { this.lex.popFront(); + subRules = ["FTDS", "FTS"]; if(this.lex.front.type == TokenType.name) { Token tc = this.lex.front; this.lex.popFront(); + subRules = ["FTDS"]; if(this.firstDirectives()) { - uint dirs = this.parseDirectives(); + Directives dirs = this.parseDirectives(); + subRules = ["FTDS"]; if(this.firstSelectionSet()) { - uint ss = this.parseSelectionSet(); - - this.fragmentDefinitions ~= FragmentDefinition.ConstructFTDS(name, tc, dirs, ss); - return cast(uint)(this.fragmentDefinitions.length - 1); + SelectionSet ss = this.parseSelectionSet(); + return new FragmentDefinition(FragmentDefinitionEnum.FTDS + , name + , tc + , dirs + , ss + ); } auto app = appender!string(); formattedWrite(app, @@ -1197,11 +1240,13 @@ struct Parser { ); } else if(this.firstSelectionSet()) { - uint ss = this.parseSelectionSet(); - - this.fragmentDefinitions ~= FragmentDefinition.ConstructFTS(name, tc, ss); - return cast(uint)(this.fragmentDefinitions.length - 1); + SelectionSet ss = this.parseSelectionSet(); + return new FragmentDefinition(FragmentDefinitionEnum.FTS + , name + , tc + , ss + ); } auto app = appender!string(); formattedWrite(app, @@ -1268,7 +1313,7 @@ struct Parser { return this.firstDirective(); } - uint parseDirectives() { + Directives parseDirectives() { try { return this.parseDirectivesImpl(); } catch(ParseException e) { @@ -1279,20 +1324,23 @@ struct Parser { } } - uint parseDirectivesImpl() { + Directives parseDirectivesImpl() { string[] subRules; + subRules = ["Dir", "Dirs"]; if(this.firstDirective()) { - uint dir = this.parseDirective(); + Directive dir = this.parseDirective(); + subRules = ["Dirs"]; if(this.firstDirectives()) { - uint follow = this.parseDirectives(); - - this.directivess ~= Directives.ConstructDirs(dir, follow); - return cast(uint)(this.directivess.length - 1); + Directives follow = this.parseDirectives(); + return new Directives(DirectivesEnum.Dirs + , dir + , follow + ); } - this.directivess ~= Directives.ConstructDir(dir); - return cast(uint)(this.directivess.length - 1); - + return new Directives(DirectivesEnum.Dir + , dir + ); } auto app = appender!string(); formattedWrite(app, @@ -1311,7 +1359,7 @@ struct Parser { return this.lex.front.type == TokenType.at; } - uint parseDirective() { + Directive parseDirective() { try { return this.parseDirectiveImpl(); } catch(ParseException e) { @@ -1322,23 +1370,27 @@ struct Parser { } } - uint parseDirectiveImpl() { + Directive parseDirectiveImpl() { string[] subRules; + subRules = ["N", "NArg"]; if(this.lex.front.type == TokenType.at) { this.lex.popFront(); + subRules = ["N", "NArg"]; if(this.lex.front.type == TokenType.name) { Token name = this.lex.front; this.lex.popFront(); + subRules = ["NArg"]; if(this.firstArguments()) { - uint arg = this.parseArguments(); - - this.directives ~= Directive.ConstructNArg(name, arg); - return cast(uint)(this.directives.length - 1); + Arguments arg = this.parseArguments(); + return new Directive(DirectiveEnum.NArg + , name + , arg + ); } - this.directives ~= Directive.ConstructN(name); - return cast(uint)(this.directives.length - 1); - + return new Directive(DirectiveEnum.N + , name + ); } auto app = appender!string(); formattedWrite(app, @@ -1369,7 +1421,7 @@ struct Parser { return this.lex.front.type == TokenType.lparen; } - uint parseVariableDefinitions() { + VariableDefinitions parseVariableDefinitions() { try { return this.parseVariableDefinitionsImpl(); } catch(ParseException e) { @@ -1380,24 +1432,26 @@ struct Parser { } } - uint parseVariableDefinitionsImpl() { + VariableDefinitions parseVariableDefinitionsImpl() { string[] subRules; + subRules = ["Empty", "Vars"]; if(this.lex.front.type == TokenType.lparen) { this.lex.popFront(); + subRules = ["Empty"]; if(this.lex.front.type == TokenType.rparen) { this.lex.popFront(); - this.variableDefinitionss ~= VariableDefinitions.ConstructEmpty(); - return cast(uint)(this.variableDefinitionss.length - 1); - + return new VariableDefinitions(VariableDefinitionsEnum.Empty + ); } else if(this.firstVariableDefinitionList()) { - uint vars = this.parseVariableDefinitionList(); + VariableDefinitionList vars = this.parseVariableDefinitionList(); + subRules = ["Vars"]; if(this.lex.front.type == TokenType.rparen) { this.lex.popFront(); - this.variableDefinitionss ~= VariableDefinitions.ConstructVars(vars); - return cast(uint)(this.variableDefinitionss.length - 1); - + return new VariableDefinitions(VariableDefinitionsEnum.Vars + , vars + ); } auto app = appender!string(); formattedWrite(app, @@ -1440,7 +1494,7 @@ struct Parser { return this.firstVariableDefinition(); } - uint parseVariableDefinitionList() { + VariableDefinitionList parseVariableDefinitionList() { try { return this.parseVariableDefinitionListImpl(); } catch(ParseException e) { @@ -1451,18 +1505,22 @@ struct Parser { } } - uint parseVariableDefinitionListImpl() { + VariableDefinitionList parseVariableDefinitionListImpl() { string[] subRules; + subRules = ["V", "VCF", "VF"]; if(this.firstVariableDefinition()) { - uint var = this.parseVariableDefinition(); + VariableDefinition var = this.parseVariableDefinition(); + subRules = ["VCF"]; if(this.lex.front.type == TokenType.comma) { this.lex.popFront(); + subRules = ["VCF"]; if(this.firstVariableDefinitionList()) { - uint follow = this.parseVariableDefinitionList(); - - this.variableDefinitionLists ~= VariableDefinitionList.ConstructVCF(var, follow); - return cast(uint)(this.variableDefinitionLists.length - 1); + VariableDefinitionList follow = this.parseVariableDefinitionList(); + return new VariableDefinitionList(VariableDefinitionListEnum.VCF + , var + , follow + ); } auto app = appender!string(); formattedWrite(app, @@ -1476,15 +1534,16 @@ struct Parser { ); } else if(this.firstVariableDefinitionList()) { - uint follow = this.parseVariableDefinitionList(); - - this.variableDefinitionLists ~= VariableDefinitionList.ConstructVF(var, follow); - return cast(uint)(this.variableDefinitionLists.length - 1); + VariableDefinitionList follow = this.parseVariableDefinitionList(); + return new VariableDefinitionList(VariableDefinitionListEnum.VF + , var + , follow + ); } - this.variableDefinitionLists ~= VariableDefinitionList.ConstructV(var); - return cast(uint)(this.variableDefinitionLists.length - 1); - + return new VariableDefinitionList(VariableDefinitionListEnum.V + , var + ); } auto app = appender!string(); formattedWrite(app, @@ -1503,7 +1562,7 @@ struct Parser { return this.firstVariable(); } - uint parseVariableDefinition() { + VariableDefinition parseVariableDefinition() { try { return this.parseVariableDefinitionImpl(); } catch(ParseException e) { @@ -1514,24 +1573,31 @@ struct Parser { } } - uint parseVariableDefinitionImpl() { + VariableDefinition parseVariableDefinitionImpl() { string[] subRules; + subRules = ["Var", "VarD"]; if(this.firstVariable()) { - uint var = this.parseVariable(); + Variable var = this.parseVariable(); + subRules = ["Var", "VarD"]; if(this.lex.front.type == TokenType.colon) { this.lex.popFront(); + subRules = ["Var", "VarD"]; if(this.firstType()) { - uint type = this.parseType(); + Type type = this.parseType(); + subRules = ["VarD"]; if(this.firstDefaultValue()) { - uint dvalue = this.parseDefaultValue(); - - this.variableDefinitions ~= VariableDefinition.ConstructVarD(var, type, dvalue); - return cast(uint)(this.variableDefinitions.length - 1); + DefaultValue dvalue = this.parseDefaultValue(); + return new VariableDefinition(VariableDefinitionEnum.VarD + , var + , type + , dvalue + ); } - this.variableDefinitions ~= VariableDefinition.ConstructVar(var, type); - return cast(uint)(this.variableDefinitions.length - 1); - + return new VariableDefinition(VariableDefinitionEnum.Var + , var + , type + ); } auto app = appender!string(); formattedWrite(app, @@ -1574,7 +1640,7 @@ struct Parser { return this.lex.front.type == TokenType.dollar; } - uint parseVariable() { + Variable parseVariable() { try { return this.parseVariableImpl(); } catch(ParseException e) { @@ -1585,17 +1651,19 @@ struct Parser { } } - uint parseVariableImpl() { + Variable parseVariableImpl() { string[] subRules; + subRules = ["Var"]; if(this.lex.front.type == TokenType.dollar) { this.lex.popFront(); + subRules = ["Var"]; if(this.lex.front.type == TokenType.name) { Token name = this.lex.front; this.lex.popFront(); - this.variables ~= Variable.ConstructVar(name); - return cast(uint)(this.variables.length - 1); - + return new Variable(VariableEnum.Var + , name + ); } auto app = appender!string(); formattedWrite(app, @@ -1626,7 +1694,7 @@ struct Parser { return this.lex.front.type == TokenType.equal; } - uint parseDefaultValue() { + DefaultValue parseDefaultValue() { try { return this.parseDefaultValueImpl(); } catch(ParseException e) { @@ -1637,16 +1705,18 @@ struct Parser { } } - uint parseDefaultValueImpl() { + DefaultValue parseDefaultValueImpl() { string[] subRules; + subRules = ["DV"]; if(this.lex.front.type == TokenType.equal) { this.lex.popFront(); + subRules = ["DV"]; if(this.firstValue()) { - uint value = this.parseValue(); - - this.defaultValues ~= DefaultValue.ConstructDV(value); - return cast(uint)(this.defaultValues.length - 1); + Value value = this.parseValue(); + return new DefaultValue(DefaultValueEnum.DV + , value + ); } auto app = appender!string(); formattedWrite(app, @@ -1678,7 +1748,7 @@ struct Parser { || this.firstVariable(); } - uint parseValueOrVariable() { + ValueOrVariable parseValueOrVariable() { try { return this.parseValueOrVariableImpl(); } catch(ParseException e) { @@ -1689,20 +1759,21 @@ struct Parser { } } - uint parseValueOrVariableImpl() { + ValueOrVariable parseValueOrVariableImpl() { string[] subRules; + subRules = ["Val"]; if(this.firstValue()) { - uint val = this.parseValue(); - - this.valueOrVariables ~= ValueOrVariable.ConstructVal(val); - return cast(uint)(this.valueOrVariables.length - 1); + Value val = this.parseValue(); + return new ValueOrVariable(ValueOrVariableEnum.Val + , val + ); } else if(this.firstVariable()) { - uint var = this.parseVariable(); - - this.valueOrVariables ~= ValueOrVariable.ConstructVar(var); - return cast(uint)(this.valueOrVariables.length - 1); + Variable var = this.parseVariable(); + return new ValueOrVariable(ValueOrVariableEnum.Var + , var + ); } auto app = appender!string(); formattedWrite(app, @@ -1729,7 +1800,7 @@ struct Parser { || this.lex.front.type == TokenType.null_; } - uint parseValue() { + Value parseValue() { try { return this.parseValueImpl(); } catch(ParseException e) { @@ -1740,69 +1811,70 @@ struct Parser { } } - uint parseValueImpl() { + Value parseValueImpl() { string[] subRules; + subRules = ["STR"]; if(this.lex.front.type == TokenType.stringValue) { Token tok = this.lex.front; this.lex.popFront(); - this.values ~= Value.ConstructSTR(tok); - return cast(uint)(this.values.length - 1); - + return new Value(ValueEnum.STR + , tok + ); } else if(this.lex.front.type == TokenType.intValue) { Token tok = this.lex.front; this.lex.popFront(); - this.values ~= Value.ConstructINT(tok); - return cast(uint)(this.values.length - 1); - + return new Value(ValueEnum.INT + , tok + ); } else if(this.lex.front.type == TokenType.floatValue) { Token tok = this.lex.front; this.lex.popFront(); - this.values ~= Value.ConstructFLOAT(tok); - return cast(uint)(this.values.length - 1); - + return new Value(ValueEnum.FLOAT + , tok + ); } else if(this.lex.front.type == TokenType.true_) { Token tok = this.lex.front; this.lex.popFront(); - this.values ~= Value.ConstructT(tok); - return cast(uint)(this.values.length - 1); - + return new Value(ValueEnum.T + , tok + ); } else if(this.lex.front.type == TokenType.false_) { Token tok = this.lex.front; this.lex.popFront(); - this.values ~= Value.ConstructF(tok); - return cast(uint)(this.values.length - 1); - + return new Value(ValueEnum.F + , tok + ); } else if(this.firstArray()) { - uint arr = this.parseArray(); - - this.values ~= Value.ConstructARR(arr); - return cast(uint)(this.values.length - 1); + Array arr = this.parseArray(); + return new Value(ValueEnum.ARR + , arr + ); } else if(this.firstObjectType()) { - uint obj = this.parseObjectType(); - - this.values ~= Value.ConstructO(obj); - return cast(uint)(this.values.length - 1); + ObjectType obj = this.parseObjectType(); + return new Value(ValueEnum.O + , obj + ); } else if(this.lex.front.type == TokenType.name) { Token tok = this.lex.front; this.lex.popFront(); - this.values ~= Value.ConstructE(tok); - return cast(uint)(this.values.length - 1); - + return new Value(ValueEnum.E + , tok + ); } else if(this.lex.front.type == TokenType.null_) { Token tok = this.lex.front; this.lex.popFront(); - this.values ~= Value.ConstructN(tok); - return cast(uint)(this.values.length - 1); - + return new Value(ValueEnum.N + , tok + ); } auto app = appender!string(); formattedWrite(app, @@ -1822,7 +1894,7 @@ struct Parser { || this.firstListType(); } - uint parseType() { + Type parseType() { try { return this.parseTypeImpl(); } catch(ParseException e) { @@ -1833,33 +1905,36 @@ struct Parser { } } - uint parseTypeImpl() { + Type parseTypeImpl() { string[] subRules; + subRules = ["T", "TN"]; if(this.lex.front.type == TokenType.name) { Token tname = this.lex.front; this.lex.popFront(); + subRules = ["TN"]; if(this.lex.front.type == TokenType.exclamation) { this.lex.popFront(); - this.types ~= Type.ConstructTN(tname); - return cast(uint)(this.types.length - 1); - + return new Type(TypeEnum.TN + , tname + ); } - this.types ~= Type.ConstructT(tname); - return cast(uint)(this.types.length - 1); - + return new Type(TypeEnum.T + , tname + ); } else if(this.firstListType()) { - uint list = this.parseListType(); + ListType list = this.parseListType(); + subRules = ["LN"]; if(this.lex.front.type == TokenType.exclamation) { this.lex.popFront(); - this.types ~= Type.ConstructLN(list); - return cast(uint)(this.types.length - 1); - + return new Type(TypeEnum.LN + , list + ); } - this.types ~= Type.ConstructL(list); - return cast(uint)(this.types.length - 1); - + return new Type(TypeEnum.L + , list + ); } auto app = appender!string(); formattedWrite(app, @@ -1878,7 +1953,7 @@ struct Parser { return this.lex.front.type == TokenType.lbrack; } - uint parseListType() { + ListType parseListType() { try { return this.parseListTypeImpl(); } catch(ParseException e) { @@ -1889,18 +1964,21 @@ struct Parser { } } - uint parseListTypeImpl() { + ListType parseListTypeImpl() { string[] subRules; + subRules = ["T"]; if(this.lex.front.type == TokenType.lbrack) { this.lex.popFront(); + subRules = ["T"]; if(this.firstType()) { - uint type = this.parseType(); + Type type = this.parseType(); + subRules = ["T"]; if(this.lex.front.type == TokenType.rbrack) { this.lex.popFront(); - this.listTypes ~= ListType.ConstructT(type); - return cast(uint)(this.listTypes.length - 1); - + return new ListType(ListTypeEnum.T + , type + ); } auto app = appender!string(); formattedWrite(app, @@ -1943,7 +2021,7 @@ struct Parser { return this.firstValue(); } - uint parseValues() { + Values parseValues() { try { return this.parseValuesImpl(); } catch(ParseException e) { @@ -1954,18 +2032,22 @@ struct Parser { } } - uint parseValuesImpl() { + Values parseValuesImpl() { string[] subRules; + subRules = ["Val", "Vals", "ValsNoComma"]; if(this.firstValue()) { - uint val = this.parseValue(); + Value val = this.parseValue(); + subRules = ["Vals"]; if(this.lex.front.type == TokenType.comma) { this.lex.popFront(); + subRules = ["Vals"]; if(this.firstValues()) { - uint follow = this.parseValues(); - - this.valuess ~= Values.ConstructVals(val, follow); - return cast(uint)(this.valuess.length - 1); + Values follow = this.parseValues(); + return new Values(ValuesEnum.Vals + , val + , follow + ); } auto app = appender!string(); formattedWrite(app, @@ -1979,15 +2061,16 @@ struct Parser { ); } else if(this.firstValues()) { - uint follow = this.parseValues(); - - this.valuess ~= Values.ConstructValsNoComma(val, follow); - return cast(uint)(this.valuess.length - 1); + Values follow = this.parseValues(); + return new Values(ValuesEnum.ValsNoComma + , val + , follow + ); } - this.valuess ~= Values.ConstructVal(val); - return cast(uint)(this.valuess.length - 1); - + return new Values(ValuesEnum.Val + , val + ); } auto app = appender!string(); formattedWrite(app, @@ -2006,7 +2089,7 @@ struct Parser { return this.lex.front.type == TokenType.lbrack; } - uint parseArray() { + Array parseArray() { try { return this.parseArrayImpl(); } catch(ParseException e) { @@ -2017,24 +2100,26 @@ struct Parser { } } - uint parseArrayImpl() { + Array parseArrayImpl() { string[] subRules; + subRules = ["Empty", "Value"]; if(this.lex.front.type == TokenType.lbrack) { this.lex.popFront(); + subRules = ["Empty"]; if(this.lex.front.type == TokenType.rbrack) { this.lex.popFront(); - this.arrays ~= Array.ConstructEmpty(); - return cast(uint)(this.arrays.length - 1); - + return new Array(ArrayEnum.Empty + ); } else if(this.firstValues()) { - uint vals = this.parseValues(); + Values vals = this.parseValues(); + subRules = ["Value"]; if(this.lex.front.type == TokenType.rbrack) { this.lex.popFront(); - this.arrays ~= Array.ConstructValue(vals); - return cast(uint)(this.arrays.length - 1); - + return new Array(ArrayEnum.Value + , vals + ); } auto app = appender!string(); formattedWrite(app, @@ -2077,7 +2162,7 @@ struct Parser { return this.lex.front.type == TokenType.name; } - uint parseObjectValues() { + ObjectValues parseObjectValues() { try { return this.parseObjectValuesImpl(); } catch(ParseException e) { @@ -2088,23 +2173,30 @@ struct Parser { } } - uint parseObjectValuesImpl() { + ObjectValues parseObjectValuesImpl() { string[] subRules; + subRules = ["V", "Vs", "Vsc"]; if(this.lex.front.type == TokenType.name) { Token name = this.lex.front; this.lex.popFront(); + subRules = ["V", "Vs", "Vsc"]; if(this.lex.front.type == TokenType.colon) { this.lex.popFront(); + subRules = ["V", "Vs", "Vsc"]; if(this.firstValueOrVariable()) { - uint val = this.parseValueOrVariable(); + ValueOrVariable val = this.parseValueOrVariable(); + subRules = ["Vsc"]; if(this.lex.front.type == TokenType.comma) { this.lex.popFront(); + subRules = ["Vsc"]; if(this.firstObjectValues()) { - uint follow = this.parseObjectValues(); - - this.objectValuess ~= ObjectValues.ConstructVsc(name, val, follow); - return cast(uint)(this.objectValuess.length - 1); + ObjectValues follow = this.parseObjectValues(); + return new ObjectValues(ObjectValuesEnum.Vsc + , name + , val + , follow + ); } auto app = appender!string(); formattedWrite(app, @@ -2118,15 +2210,18 @@ struct Parser { ); } else if(this.firstObjectValues()) { - uint follow = this.parseObjectValues(); - - this.objectValuess ~= ObjectValues.ConstructVs(name, val, follow); - return cast(uint)(this.objectValuess.length - 1); + ObjectValues follow = this.parseObjectValues(); + return new ObjectValues(ObjectValuesEnum.Vs + , name + , val + , follow + ); } - this.objectValuess ~= ObjectValues.ConstructV(name, val); - return cast(uint)(this.objectValuess.length - 1); - + return new ObjectValues(ObjectValuesEnum.V + , name + , val + ); } auto app = appender!string(); formattedWrite(app, @@ -2169,7 +2264,7 @@ struct Parser { return this.lex.front.type == TokenType.lcurly; } - uint parseObjectType() { + ObjectType parseObjectType() { try { return this.parseObjectTypeImpl(); } catch(ParseException e) { @@ -2180,18 +2275,21 @@ struct Parser { } } - uint parseObjectTypeImpl() { + ObjectType parseObjectTypeImpl() { string[] subRules; + subRules = ["Var"]; if(this.lex.front.type == TokenType.lcurly) { this.lex.popFront(); + subRules = ["Var"]; if(this.firstObjectValues()) { - uint vals = this.parseObjectValues(); + ObjectValues vals = this.parseObjectValues(); + subRules = ["Var"]; if(this.lex.front.type == TokenType.rcurly) { this.lex.popFront(); - this.objectTypes ~= ObjectType.ConstructVar(vals); - return cast(uint)(this.objectTypes.length - 1); - + return new ObjectType(ObjectTypeEnum.Var + , vals + ); } auto app = appender!string(); formattedWrite(app, @@ -2238,7 +2336,7 @@ struct Parser { || this.firstDescription(); } - uint parseTypeSystemDefinition() { + TypeSystemDefinition parseTypeSystemDefinition() { try { return this.parseTypeSystemDefinitionImpl(); } catch(ParseException e) { @@ -2249,58 +2347,64 @@ struct Parser { } } - uint parseTypeSystemDefinitionImpl() { + TypeSystemDefinition parseTypeSystemDefinitionImpl() { string[] subRules; + subRules = ["S"]; if(this.firstSchemaDefinition()) { - uint sch = this.parseSchemaDefinition(); - - this.typeSystemDefinitions ~= TypeSystemDefinition.ConstructS(sch); - return cast(uint)(this.typeSystemDefinitions.length - 1); + SchemaDefinition sch = this.parseSchemaDefinition(); + return new TypeSystemDefinition(TypeSystemDefinitionEnum.S + , sch + ); } else if(this.firstTypeDefinition()) { - uint td = this.parseTypeDefinition(); - - this.typeSystemDefinitions ~= TypeSystemDefinition.ConstructT(td); - return cast(uint)(this.typeSystemDefinitions.length - 1); + TypeDefinition td = this.parseTypeDefinition(); + return new TypeSystemDefinition(TypeSystemDefinitionEnum.T + , td + ); } else if(this.firstTypeExtensionDefinition()) { - uint ted = this.parseTypeExtensionDefinition(); - - this.typeSystemDefinitions ~= TypeSystemDefinition.ConstructTE(ted); - return cast(uint)(this.typeSystemDefinitions.length - 1); + TypeExtensionDefinition ted = this.parseTypeExtensionDefinition(); + return new TypeSystemDefinition(TypeSystemDefinitionEnum.TE + , ted + ); } else if(this.firstDirectiveDefinition()) { - uint dd = this.parseDirectiveDefinition(); - - this.typeSystemDefinitions ~= TypeSystemDefinition.ConstructD(dd); - return cast(uint)(this.typeSystemDefinitions.length - 1); + DirectiveDefinition dd = this.parseDirectiveDefinition(); + return new TypeSystemDefinition(TypeSystemDefinitionEnum.D + , dd + ); } else if(this.firstDescription()) { - uint des = this.parseDescription(); + Description des = this.parseDescription(); + subRules = ["DS"]; if(this.firstSchemaDefinition()) { - uint sch = this.parseSchemaDefinition(); - - this.typeSystemDefinitions ~= TypeSystemDefinition.ConstructDS(des, sch); - return cast(uint)(this.typeSystemDefinitions.length - 1); + SchemaDefinition sch = this.parseSchemaDefinition(); + return new TypeSystemDefinition(TypeSystemDefinitionEnum.DS + , des + , sch + ); } else if(this.firstTypeDefinition()) { - uint td = this.parseTypeDefinition(); - - this.typeSystemDefinitions ~= TypeSystemDefinition.ConstructDT(des, td); - return cast(uint)(this.typeSystemDefinitions.length - 1); + TypeDefinition td = this.parseTypeDefinition(); + return new TypeSystemDefinition(TypeSystemDefinitionEnum.DT + , des + , td + ); } else if(this.firstTypeExtensionDefinition()) { - uint ted = this.parseTypeExtensionDefinition(); - - this.typeSystemDefinitions ~= TypeSystemDefinition.ConstructDTE(des, ted); - return cast(uint)(this.typeSystemDefinitions.length - 1); + TypeExtensionDefinition ted = this.parseTypeExtensionDefinition(); + return new TypeSystemDefinition(TypeSystemDefinitionEnum.DTE + , des + , ted + ); } else if(this.firstDirectiveDefinition()) { - uint dd = this.parseDirectiveDefinition(); - - this.typeSystemDefinitions ~= TypeSystemDefinition.ConstructDD(des, dd); - return cast(uint)(this.typeSystemDefinitions.length - 1); + DirectiveDefinition dd = this.parseDirectiveDefinition(); + return new TypeSystemDefinition(TypeSystemDefinitionEnum.DD + , des + , dd + ); } auto app = appender!string(); formattedWrite(app, @@ -2336,7 +2440,7 @@ struct Parser { || this.firstInputObjectTypeDefinition(); } - uint parseTypeDefinition() { + TypeDefinition parseTypeDefinition() { try { return this.parseTypeDefinitionImpl(); } catch(ParseException e) { @@ -2347,44 +2451,45 @@ struct Parser { } } - uint parseTypeDefinitionImpl() { + TypeDefinition parseTypeDefinitionImpl() { string[] subRules; + subRules = ["S"]; if(this.firstScalarTypeDefinition()) { - uint std = this.parseScalarTypeDefinition(); - - this.typeDefinitions ~= TypeDefinition.ConstructS(std); - return cast(uint)(this.typeDefinitions.length - 1); + ScalarTypeDefinition std = this.parseScalarTypeDefinition(); + return new TypeDefinition(TypeDefinitionEnum.S + , std + ); } else if(this.firstObjectTypeDefinition()) { - uint otd = this.parseObjectTypeDefinition(); - - this.typeDefinitions ~= TypeDefinition.ConstructO(otd); - return cast(uint)(this.typeDefinitions.length - 1); + ObjectTypeDefinition otd = this.parseObjectTypeDefinition(); + return new TypeDefinition(TypeDefinitionEnum.O + , otd + ); } else if(this.firstInterfaceTypeDefinition()) { - uint itd = this.parseInterfaceTypeDefinition(); - - this.typeDefinitions ~= TypeDefinition.ConstructI(itd); - return cast(uint)(this.typeDefinitions.length - 1); + InterfaceTypeDefinition itd = this.parseInterfaceTypeDefinition(); + return new TypeDefinition(TypeDefinitionEnum.I + , itd + ); } else if(this.firstUnionTypeDefinition()) { - uint utd = this.parseUnionTypeDefinition(); - - this.typeDefinitions ~= TypeDefinition.ConstructU(utd); - return cast(uint)(this.typeDefinitions.length - 1); + UnionTypeDefinition utd = this.parseUnionTypeDefinition(); + return new TypeDefinition(TypeDefinitionEnum.U + , utd + ); } else if(this.firstEnumTypeDefinition()) { - uint etd = this.parseEnumTypeDefinition(); - - this.typeDefinitions ~= TypeDefinition.ConstructE(etd); - return cast(uint)(this.typeDefinitions.length - 1); + EnumTypeDefinition etd = this.parseEnumTypeDefinition(); + return new TypeDefinition(TypeDefinitionEnum.E + , etd + ); } else if(this.firstInputObjectTypeDefinition()) { - uint iod = this.parseInputObjectTypeDefinition(); - - this.typeDefinitions ~= TypeDefinition.ConstructIO(iod); - return cast(uint)(this.typeDefinitions.length - 1); + InputObjectTypeDefinition iod = this.parseInputObjectTypeDefinition(); + return new TypeDefinition(TypeDefinitionEnum.IO + , iod + ); } auto app = appender!string(); formattedWrite(app, @@ -2403,7 +2508,7 @@ struct Parser { return this.lex.front.type == TokenType.schema; } - uint parseSchemaDefinition() { + SchemaDefinition parseSchemaDefinition() { try { return this.parseSchemaDefinitionImpl(); } catch(ParseException e) { @@ -2414,22 +2519,28 @@ struct Parser { } } - uint parseSchemaDefinitionImpl() { + SchemaDefinition parseSchemaDefinitionImpl() { string[] subRules; + subRules = ["DO", "O"]; if(this.lex.front.type == TokenType.schema) { this.lex.popFront(); + subRules = ["DO"]; if(this.firstDirectives()) { - uint dir = this.parseDirectives(); + Directives dir = this.parseDirectives(); + subRules = ["DO"]; if(this.lex.front.type == TokenType.lcurly) { this.lex.popFront(); + subRules = ["DO"]; if(this.firstOperationTypeDefinitions()) { - uint otds = this.parseOperationTypeDefinitions(); + OperationTypeDefinitions otds = this.parseOperationTypeDefinitions(); + subRules = ["DO"]; if(this.lex.front.type == TokenType.rcurly) { this.lex.popFront(); - this.schemaDefinitions ~= SchemaDefinition.ConstructDO(dir, otds); - return cast(uint)(this.schemaDefinitions.length - 1); - + return new SchemaDefinition(SchemaDefinitionEnum.DO + , dir + , otds + ); } auto app = appender!string(); formattedWrite(app, @@ -2468,14 +2579,16 @@ struct Parser { } else if(this.lex.front.type == TokenType.lcurly) { this.lex.popFront(); + subRules = ["O"]; if(this.firstOperationTypeDefinitions()) { - uint otds = this.parseOperationTypeDefinitions(); + OperationTypeDefinitions otds = this.parseOperationTypeDefinitions(); + subRules = ["O"]; if(this.lex.front.type == TokenType.rcurly) { this.lex.popFront(); - this.schemaDefinitions ~= SchemaDefinition.ConstructO(otds); - return cast(uint)(this.schemaDefinitions.length - 1); - + return new SchemaDefinition(SchemaDefinitionEnum.O + , otds + ); } auto app = appender!string(); formattedWrite(app, @@ -2530,7 +2643,7 @@ struct Parser { return this.firstOperationTypeDefinition(); } - uint parseOperationTypeDefinitions() { + OperationTypeDefinitions parseOperationTypeDefinitions() { try { return this.parseOperationTypeDefinitionsImpl(); } catch(ParseException e) { @@ -2541,18 +2654,22 @@ struct Parser { } } - uint parseOperationTypeDefinitionsImpl() { + OperationTypeDefinitions parseOperationTypeDefinitionsImpl() { string[] subRules; + subRules = ["O", "OCS", "OS"]; if(this.firstOperationTypeDefinition()) { - uint otd = this.parseOperationTypeDefinition(); + OperationTypeDefinition otd = this.parseOperationTypeDefinition(); + subRules = ["OCS"]; if(this.lex.front.type == TokenType.comma) { this.lex.popFront(); + subRules = ["OCS"]; if(this.firstOperationTypeDefinitions()) { - uint follow = this.parseOperationTypeDefinitions(); - - this.operationTypeDefinitionss ~= OperationTypeDefinitions.ConstructOCS(otd, follow); - return cast(uint)(this.operationTypeDefinitionss.length - 1); + OperationTypeDefinitions follow = this.parseOperationTypeDefinitions(); + return new OperationTypeDefinitions(OperationTypeDefinitionsEnum.OCS + , otd + , follow + ); } auto app = appender!string(); formattedWrite(app, @@ -2566,15 +2683,16 @@ struct Parser { ); } else if(this.firstOperationTypeDefinitions()) { - uint follow = this.parseOperationTypeDefinitions(); - - this.operationTypeDefinitionss ~= OperationTypeDefinitions.ConstructOS(otd, follow); - return cast(uint)(this.operationTypeDefinitionss.length - 1); + OperationTypeDefinitions follow = this.parseOperationTypeDefinitions(); + return new OperationTypeDefinitions(OperationTypeDefinitionsEnum.OS + , otd + , follow + ); } - this.operationTypeDefinitionss ~= OperationTypeDefinitions.ConstructO(otd); - return cast(uint)(this.operationTypeDefinitionss.length - 1); - + return new OperationTypeDefinitions(OperationTypeDefinitionsEnum.O + , otd + ); } auto app = appender!string(); formattedWrite(app, @@ -2593,7 +2711,7 @@ struct Parser { return this.firstOperationType(); } - uint parseOperationTypeDefinition() { + OperationTypeDefinition parseOperationTypeDefinition() { try { return this.parseOperationTypeDefinitionImpl(); } catch(ParseException e) { @@ -2604,19 +2722,23 @@ struct Parser { } } - uint parseOperationTypeDefinitionImpl() { + OperationTypeDefinition parseOperationTypeDefinitionImpl() { string[] subRules; + subRules = ["O"]; if(this.firstOperationType()) { - uint ot = this.parseOperationType(); + OperationType ot = this.parseOperationType(); + subRules = ["O"]; if(this.lex.front.type == TokenType.colon) { this.lex.popFront(); + subRules = ["O"]; if(this.lex.front.type == TokenType.name) { Token nt = this.lex.front; this.lex.popFront(); - this.operationTypeDefinitions ~= OperationTypeDefinition.ConstructO(ot, nt); - return cast(uint)(this.operationTypeDefinitions.length - 1); - + return new OperationTypeDefinition(OperationTypeDefinitionEnum.O + , ot + , nt + ); } auto app = appender!string(); formattedWrite(app, @@ -2659,7 +2781,7 @@ struct Parser { return this.lex.front.type == TokenType.scalar; } - uint parseScalarTypeDefinition() { + ScalarTypeDefinition parseScalarTypeDefinition() { try { return this.parseScalarTypeDefinitionImpl(); } catch(ParseException e) { @@ -2670,23 +2792,27 @@ struct Parser { } } - uint parseScalarTypeDefinitionImpl() { + ScalarTypeDefinition parseScalarTypeDefinitionImpl() { string[] subRules; + subRules = ["D", "S"]; if(this.lex.front.type == TokenType.scalar) { this.lex.popFront(); + subRules = ["D", "S"]; if(this.lex.front.type == TokenType.name) { Token name = this.lex.front; this.lex.popFront(); + subRules = ["D"]; if(this.firstDirectives()) { - uint dir = this.parseDirectives(); - - this.scalarTypeDefinitions ~= ScalarTypeDefinition.ConstructD(name, dir); - return cast(uint)(this.scalarTypeDefinitions.length - 1); + Directives dir = this.parseDirectives(); + return new ScalarTypeDefinition(ScalarTypeDefinitionEnum.D + , name + , dir + ); } - this.scalarTypeDefinitions ~= ScalarTypeDefinition.ConstructS(name); - return cast(uint)(this.scalarTypeDefinitions.length - 1); - + return new ScalarTypeDefinition(ScalarTypeDefinitionEnum.S + , name + ); } auto app = appender!string(); formattedWrite(app, @@ -2717,7 +2843,7 @@ struct Parser { return this.lex.front.type == TokenType.type; } - uint parseObjectTypeDefinition() { + ObjectTypeDefinition parseObjectTypeDefinition() { try { return this.parseObjectTypeDefinitionImpl(); } catch(ParseException e) { @@ -2728,27 +2854,37 @@ struct Parser { } } - uint parseObjectTypeDefinitionImpl() { + ObjectTypeDefinition parseObjectTypeDefinitionImpl() { string[] subRules; + subRules = ["D", "F", "I", "ID"]; if(this.lex.front.type == TokenType.type) { this.lex.popFront(); + subRules = ["D", "F", "I", "ID"]; if(this.lex.front.type == TokenType.name) { Token name = this.lex.front; this.lex.popFront(); + subRules = ["I", "ID"]; if(this.firstImplementsInterfaces()) { - uint ii = this.parseImplementsInterfaces(); + ImplementsInterfaces ii = this.parseImplementsInterfaces(); + subRules = ["ID"]; if(this.firstDirectives()) { - uint dir = this.parseDirectives(); + Directives dir = this.parseDirectives(); + subRules = ["ID"]; if(this.lex.front.type == TokenType.lcurly) { this.lex.popFront(); + subRules = ["ID"]; if(this.firstFieldDefinitions()) { - uint fds = this.parseFieldDefinitions(); + FieldDefinitions fds = this.parseFieldDefinitions(); + subRules = ["ID"]; if(this.lex.front.type == TokenType.rcurly) { this.lex.popFront(); - this.objectTypeDefinitions ~= ObjectTypeDefinition.ConstructID(name, ii, dir, fds); - return cast(uint)(this.objectTypeDefinitions.length - 1); - + return new ObjectTypeDefinition(ObjectTypeDefinitionEnum.ID + , name + , ii + , dir + , fds + ); } auto app = appender!string(); formattedWrite(app, @@ -2787,14 +2923,18 @@ struct Parser { } else if(this.lex.front.type == TokenType.lcurly) { this.lex.popFront(); + subRules = ["I"]; if(this.firstFieldDefinitions()) { - uint fds = this.parseFieldDefinitions(); + FieldDefinitions fds = this.parseFieldDefinitions(); + subRules = ["I"]; if(this.lex.front.type == TokenType.rcurly) { this.lex.popFront(); - this.objectTypeDefinitions ~= ObjectTypeDefinition.ConstructI(name, ii, fds); - return cast(uint)(this.objectTypeDefinitions.length - 1); - + return new ObjectTypeDefinition(ObjectTypeDefinitionEnum.I + , name + , ii + , fds + ); } auto app = appender!string(); formattedWrite(app, @@ -2832,17 +2972,22 @@ struct Parser { ); } else if(this.firstDirectives()) { - uint dir = this.parseDirectives(); + Directives dir = this.parseDirectives(); + subRules = ["D"]; if(this.lex.front.type == TokenType.lcurly) { this.lex.popFront(); + subRules = ["D"]; if(this.firstFieldDefinitions()) { - uint fds = this.parseFieldDefinitions(); + FieldDefinitions fds = this.parseFieldDefinitions(); + subRules = ["D"]; if(this.lex.front.type == TokenType.rcurly) { this.lex.popFront(); - this.objectTypeDefinitions ~= ObjectTypeDefinition.ConstructD(name, dir, fds); - return cast(uint)(this.objectTypeDefinitions.length - 1); - + return new ObjectTypeDefinition(ObjectTypeDefinitionEnum.D + , name + , dir + , fds + ); } auto app = appender!string(); formattedWrite(app, @@ -2881,14 +3026,17 @@ struct Parser { } else if(this.lex.front.type == TokenType.lcurly) { this.lex.popFront(); + subRules = ["F"]; if(this.firstFieldDefinitions()) { - uint fds = this.parseFieldDefinitions(); + FieldDefinitions fds = this.parseFieldDefinitions(); + subRules = ["F"]; if(this.lex.front.type == TokenType.rcurly) { this.lex.popFront(); - this.objectTypeDefinitions ~= ObjectTypeDefinition.ConstructF(name, fds); - return cast(uint)(this.objectTypeDefinitions.length - 1); - + return new ObjectTypeDefinition(ObjectTypeDefinitionEnum.F + , name + , fds + ); } auto app = appender!string(); formattedWrite(app, @@ -2955,7 +3103,7 @@ struct Parser { return this.firstFieldDefinition(); } - uint parseFieldDefinitions() { + FieldDefinitions parseFieldDefinitions() { try { return this.parseFieldDefinitionsImpl(); } catch(ParseException e) { @@ -2966,18 +3114,22 @@ struct Parser { } } - uint parseFieldDefinitionsImpl() { + FieldDefinitions parseFieldDefinitionsImpl() { string[] subRules; + subRules = ["F", "FC", "FNC"]; if(this.firstFieldDefinition()) { - uint fd = this.parseFieldDefinition(); + FieldDefinition fd = this.parseFieldDefinition(); + subRules = ["FC"]; if(this.lex.front.type == TokenType.comma) { this.lex.popFront(); + subRules = ["FC"]; if(this.firstFieldDefinitions()) { - uint follow = this.parseFieldDefinitions(); - - this.fieldDefinitionss ~= FieldDefinitions.ConstructFC(fd, follow); - return cast(uint)(this.fieldDefinitionss.length - 1); + FieldDefinitions follow = this.parseFieldDefinitions(); + return new FieldDefinitions(FieldDefinitionsEnum.FC + , fd + , follow + ); } auto app = appender!string(); formattedWrite(app, @@ -2991,15 +3143,16 @@ struct Parser { ); } else if(this.firstFieldDefinitions()) { - uint follow = this.parseFieldDefinitions(); - - this.fieldDefinitionss ~= FieldDefinitions.ConstructFNC(fd, follow); - return cast(uint)(this.fieldDefinitionss.length - 1); + FieldDefinitions follow = this.parseFieldDefinitions(); + return new FieldDefinitions(FieldDefinitionsEnum.FNC + , fd + , follow + ); } - this.fieldDefinitionss ~= FieldDefinitions.ConstructF(fd); - return cast(uint)(this.fieldDefinitionss.length - 1); - + return new FieldDefinitions(FieldDefinitionsEnum.F + , fd + ); } auto app = appender!string(); formattedWrite(app, @@ -3019,7 +3172,7 @@ struct Parser { || this.firstDescription(); } - uint parseFieldDefinition() { + FieldDefinition parseFieldDefinition() { try { return this.parseFieldDefinitionImpl(); } catch(ParseException e) { @@ -3030,27 +3183,37 @@ struct Parser { } } - uint parseFieldDefinitionImpl() { + FieldDefinition parseFieldDefinitionImpl() { string[] subRules; + subRules = ["A", "AD", "D", "T"]; if(this.lex.front.type == TokenType.name) { Token name = this.lex.front; this.lex.popFront(); + subRules = ["A", "AD"]; if(this.firstArgumentsDefinition()) { - uint arg = this.parseArgumentsDefinition(); + ArgumentsDefinition arg = this.parseArgumentsDefinition(); + subRules = ["A", "AD"]; if(this.lex.front.type == TokenType.colon) { this.lex.popFront(); + subRules = ["A", "AD"]; if(this.firstType()) { - uint typ = this.parseType(); + Type typ = this.parseType(); + subRules = ["AD"]; if(this.firstDirectives()) { - uint dir = this.parseDirectives(); - - this.fieldDefinitions ~= FieldDefinition.ConstructAD(name, arg, typ, dir); - return cast(uint)(this.fieldDefinitions.length - 1); + Directives dir = this.parseDirectives(); + return new FieldDefinition(FieldDefinitionEnum.AD + , name + , arg + , typ + , dir + ); } - this.fieldDefinitions ~= FieldDefinition.ConstructA(name, arg, typ); - return cast(uint)(this.fieldDefinitions.length - 1); - + return new FieldDefinition(FieldDefinitionEnum.A + , name + , arg + , typ + ); } auto app = appender!string(); formattedWrite(app, @@ -3077,18 +3240,23 @@ struct Parser { } else if(this.lex.front.type == TokenType.colon) { this.lex.popFront(); + subRules = ["D", "T"]; if(this.firstType()) { - uint typ = this.parseType(); + Type typ = this.parseType(); + subRules = ["D"]; if(this.firstDirectives()) { - uint dir = this.parseDirectives(); - - this.fieldDefinitions ~= FieldDefinition.ConstructD(name, typ, dir); - return cast(uint)(this.fieldDefinitions.length - 1); + Directives dir = this.parseDirectives(); + return new FieldDefinition(FieldDefinitionEnum.D + , name + , typ + , dir + ); } - this.fieldDefinitions ~= FieldDefinition.ConstructT(name, typ); - return cast(uint)(this.fieldDefinitions.length - 1); - + return new FieldDefinition(FieldDefinitionEnum.T + , name + , typ + ); } auto app = appender!string(); formattedWrite(app, @@ -3114,26 +3282,38 @@ struct Parser { ); } else if(this.firstDescription()) { - uint des = this.parseDescription(); + Description des = this.parseDescription(); + subRules = ["DA", "DAD", "DD", "DT"]; if(this.lex.front.type == TokenType.name) { Token name = this.lex.front; this.lex.popFront(); + subRules = ["DA", "DAD"]; if(this.firstArgumentsDefinition()) { - uint arg = this.parseArgumentsDefinition(); + ArgumentsDefinition arg = this.parseArgumentsDefinition(); + subRules = ["DA", "DAD"]; if(this.lex.front.type == TokenType.colon) { this.lex.popFront(); + subRules = ["DA", "DAD"]; if(this.firstType()) { - uint typ = this.parseType(); + Type typ = this.parseType(); + subRules = ["DAD"]; if(this.firstDirectives()) { - uint dir = this.parseDirectives(); - - this.fieldDefinitions ~= FieldDefinition.ConstructDAD(des, name, arg, typ, dir); - return cast(uint)(this.fieldDefinitions.length - 1); - + Directives dir = this.parseDirectives(); + + return new FieldDefinition(FieldDefinitionEnum.DAD + , des + , name + , arg + , typ + , dir + ); } - this.fieldDefinitions ~= FieldDefinition.ConstructDA(des, name, arg, typ); - return cast(uint)(this.fieldDefinitions.length - 1); - + return new FieldDefinition(FieldDefinitionEnum.DA + , des + , name + , arg + , typ + ); } auto app = appender!string(); formattedWrite(app, @@ -3160,18 +3340,25 @@ struct Parser { } else if(this.lex.front.type == TokenType.colon) { this.lex.popFront(); + subRules = ["DD", "DT"]; if(this.firstType()) { - uint typ = this.parseType(); + Type typ = this.parseType(); + subRules = ["DD"]; if(this.firstDirectives()) { - uint dir = this.parseDirectives(); - - this.fieldDefinitions ~= FieldDefinition.ConstructDD(des, name, typ, dir); - return cast(uint)(this.fieldDefinitions.length - 1); + Directives dir = this.parseDirectives(); + return new FieldDefinition(FieldDefinitionEnum.DD + , des + , name + , typ + , dir + ); } - this.fieldDefinitions ~= FieldDefinition.ConstructDT(des, name, typ); - return cast(uint)(this.fieldDefinitions.length - 1); - + return new FieldDefinition(FieldDefinitionEnum.DT + , des + , name + , typ + ); } auto app = appender!string(); formattedWrite(app, @@ -3226,7 +3413,7 @@ struct Parser { return this.lex.front.type == TokenType.implements; } - uint parseImplementsInterfaces() { + ImplementsInterfaces parseImplementsInterfaces() { try { return this.parseImplementsInterfacesImpl(); } catch(ParseException e) { @@ -3237,16 +3424,18 @@ struct Parser { } } - uint parseImplementsInterfacesImpl() { + ImplementsInterfaces parseImplementsInterfacesImpl() { string[] subRules; + subRules = ["N"]; if(this.lex.front.type == TokenType.implements) { this.lex.popFront(); + subRules = ["N"]; if(this.firstNamedTypes()) { - uint nts = this.parseNamedTypes(); - - this.implementsInterfacess ~= ImplementsInterfaces.ConstructN(nts); - return cast(uint)(this.implementsInterfacess.length - 1); + NamedTypes nts = this.parseNamedTypes(); + return new ImplementsInterfaces(ImplementsInterfacesEnum.N + , nts + ); } auto app = appender!string(); formattedWrite(app, @@ -3277,7 +3466,7 @@ struct Parser { return this.lex.front.type == TokenType.name; } - uint parseNamedTypes() { + NamedTypes parseNamedTypes() { try { return this.parseNamedTypesImpl(); } catch(ParseException e) { @@ -3288,19 +3477,23 @@ struct Parser { } } - uint parseNamedTypesImpl() { + NamedTypes parseNamedTypesImpl() { string[] subRules; + subRules = ["N", "NCS", "NS"]; if(this.lex.front.type == TokenType.name) { Token name = this.lex.front; this.lex.popFront(); + subRules = ["NCS"]; if(this.lex.front.type == TokenType.comma) { this.lex.popFront(); + subRules = ["NCS"]; if(this.firstNamedTypes()) { - uint follow = this.parseNamedTypes(); - - this.namedTypess ~= NamedTypes.ConstructNCS(name, follow); - return cast(uint)(this.namedTypess.length - 1); + NamedTypes follow = this.parseNamedTypes(); + return new NamedTypes(NamedTypesEnum.NCS + , name + , follow + ); } auto app = appender!string(); formattedWrite(app, @@ -3314,15 +3507,16 @@ struct Parser { ); } else if(this.firstNamedTypes()) { - uint follow = this.parseNamedTypes(); - - this.namedTypess ~= NamedTypes.ConstructNS(name, follow); - return cast(uint)(this.namedTypess.length - 1); + NamedTypes follow = this.parseNamedTypes(); + return new NamedTypes(NamedTypesEnum.NS + , name + , follow + ); } - this.namedTypess ~= NamedTypes.ConstructN(name); - return cast(uint)(this.namedTypess.length - 1); - + return new NamedTypes(NamedTypesEnum.N + , name + ); } auto app = appender!string(); formattedWrite(app, @@ -3341,7 +3535,7 @@ struct Parser { return this.lex.front.type == TokenType.lparen; } - uint parseArgumentsDefinition() { + ArgumentsDefinition parseArgumentsDefinition() { try { return this.parseArgumentsDefinitionImpl(); } catch(ParseException e) { @@ -3352,18 +3546,20 @@ struct Parser { } } - uint parseArgumentsDefinitionImpl() { + ArgumentsDefinition parseArgumentsDefinitionImpl() { string[] subRules; + subRules = ["A", "NA"]; if(this.lex.front.type == TokenType.lparen) { this.lex.popFront(); + subRules = ["A"]; if(this.firstInputValueDefinitions()) { this.parseInputValueDefinitions(); + subRules = ["A"]; if(this.lex.front.type == TokenType.rparen) { this.lex.popFront(); - this.argumentsDefinitions ~= ArgumentsDefinition.ConstructA(); - return cast(uint)(this.argumentsDefinitions.length - 1); - + return new ArgumentsDefinition(ArgumentsDefinitionEnum.A + ); } auto app = appender!string(); formattedWrite(app, @@ -3379,9 +3575,8 @@ struct Parser { } else if(this.lex.front.type == TokenType.rparen) { this.lex.popFront(); - this.argumentsDefinitions ~= ArgumentsDefinition.ConstructNA(); - return cast(uint)(this.argumentsDefinitions.length - 1); - + return new ArgumentsDefinition(ArgumentsDefinitionEnum.NA + ); } auto app = appender!string(); formattedWrite(app, @@ -3412,7 +3607,7 @@ struct Parser { return this.firstInputValueDefinition(); } - uint parseInputValueDefinitions() { + InputValueDefinitions parseInputValueDefinitions() { try { return this.parseInputValueDefinitionsImpl(); } catch(ParseException e) { @@ -3423,18 +3618,22 @@ struct Parser { } } - uint parseInputValueDefinitionsImpl() { + InputValueDefinitions parseInputValueDefinitionsImpl() { string[] subRules; + subRules = ["I", "ICF", "IF"]; if(this.firstInputValueDefinition()) { - uint iv = this.parseInputValueDefinition(); + InputValueDefinition iv = this.parseInputValueDefinition(); + subRules = ["ICF"]; if(this.lex.front.type == TokenType.comma) { this.lex.popFront(); + subRules = ["ICF"]; if(this.firstInputValueDefinitions()) { - uint follow = this.parseInputValueDefinitions(); - - this.inputValueDefinitionss ~= InputValueDefinitions.ConstructICF(iv, follow); - return cast(uint)(this.inputValueDefinitionss.length - 1); + InputValueDefinitions follow = this.parseInputValueDefinitions(); + return new InputValueDefinitions(InputValueDefinitionsEnum.ICF + , iv + , follow + ); } auto app = appender!string(); formattedWrite(app, @@ -3448,15 +3647,16 @@ struct Parser { ); } else if(this.firstInputValueDefinitions()) { - uint follow = this.parseInputValueDefinitions(); - - this.inputValueDefinitionss ~= InputValueDefinitions.ConstructIF(iv, follow); - return cast(uint)(this.inputValueDefinitionss.length - 1); + InputValueDefinitions follow = this.parseInputValueDefinitions(); + return new InputValueDefinitions(InputValueDefinitionsEnum.IF + , iv + , follow + ); } - this.inputValueDefinitionss ~= InputValueDefinitions.ConstructI(iv); - return cast(uint)(this.inputValueDefinitionss.length - 1); - + return new InputValueDefinitions(InputValueDefinitionsEnum.I + , iv + ); } auto app = appender!string(); formattedWrite(app, @@ -3476,7 +3676,7 @@ struct Parser { || this.firstDescription(); } - uint parseInputValueDefinition() { + InputValueDefinition parseInputValueDefinition() { try { return this.parseInputValueDefinitionImpl(); } catch(ParseException e) { @@ -3487,37 +3687,50 @@ struct Parser { } } - uint parseInputValueDefinitionImpl() { + InputValueDefinition parseInputValueDefinitionImpl() { string[] subRules; + subRules = ["T", "TD", "TV", "TVD"]; if(this.lex.front.type == TokenType.name) { Token name = this.lex.front; this.lex.popFront(); + subRules = ["T", "TD", "TV", "TVD"]; if(this.lex.front.type == TokenType.colon) { this.lex.popFront(); + subRules = ["T", "TD", "TV", "TVD"]; if(this.firstType()) { - uint type = this.parseType(); + Type type = this.parseType(); + subRules = ["TV", "TVD"]; if(this.firstDefaultValue()) { - uint df = this.parseDefaultValue(); + DefaultValue df = this.parseDefaultValue(); + subRules = ["TVD"]; if(this.firstDirectives()) { - uint dirs = this.parseDirectives(); - - this.inputValueDefinitions ~= InputValueDefinition.ConstructTVD(name, type, df, dirs); - return cast(uint)(this.inputValueDefinitions.length - 1); + Directives dirs = this.parseDirectives(); + return new InputValueDefinition(InputValueDefinitionEnum.TVD + , name + , type + , df + , dirs + ); } - this.inputValueDefinitions ~= InputValueDefinition.ConstructTV(name, type, df); - return cast(uint)(this.inputValueDefinitions.length - 1); - + return new InputValueDefinition(InputValueDefinitionEnum.TV + , name + , type + , df + ); } else if(this.firstDirectives()) { - uint dirs = this.parseDirectives(); - - this.inputValueDefinitions ~= InputValueDefinition.ConstructTD(name, type, dirs); - return cast(uint)(this.inputValueDefinitions.length - 1); + Directives dirs = this.parseDirectives(); + return new InputValueDefinition(InputValueDefinitionEnum.TD + , name + , type + , dirs + ); } - this.inputValueDefinitions ~= InputValueDefinition.ConstructT(name, type); - return cast(uint)(this.inputValueDefinitions.length - 1); - + return new InputValueDefinition(InputValueDefinitionEnum.T + , name + , type + ); } auto app = appender!string(); formattedWrite(app, @@ -3543,36 +3756,53 @@ struct Parser { ); } else if(this.firstDescription()) { - uint des = this.parseDescription(); + Description des = this.parseDescription(); + subRules = ["DT", "DTD", "DTV", "DTVD"]; if(this.lex.front.type == TokenType.name) { Token name = this.lex.front; this.lex.popFront(); + subRules = ["DT", "DTD", "DTV", "DTVD"]; if(this.lex.front.type == TokenType.colon) { this.lex.popFront(); + subRules = ["DT", "DTD", "DTV", "DTVD"]; if(this.firstType()) { - uint type = this.parseType(); + Type type = this.parseType(); + subRules = ["DTV", "DTVD"]; if(this.firstDefaultValue()) { - uint df = this.parseDefaultValue(); + DefaultValue df = this.parseDefaultValue(); + subRules = ["DTVD"]; if(this.firstDirectives()) { - uint dirs = this.parseDirectives(); - - this.inputValueDefinitions ~= InputValueDefinition.ConstructDTVD(des, name, type, df, dirs); - return cast(uint)(this.inputValueDefinitions.length - 1); - + Directives dirs = this.parseDirectives(); + + return new InputValueDefinition(InputValueDefinitionEnum.DTVD + , des + , name + , type + , df + , dirs + ); } - this.inputValueDefinitions ~= InputValueDefinition.ConstructDTV(des, name, type, df); - return cast(uint)(this.inputValueDefinitions.length - 1); - + return new InputValueDefinition(InputValueDefinitionEnum.DTV + , des + , name + , type + , df + ); } else if(this.firstDirectives()) { - uint dirs = this.parseDirectives(); - - this.inputValueDefinitions ~= InputValueDefinition.ConstructDTD(des, name, type, dirs); - return cast(uint)(this.inputValueDefinitions.length - 1); + Directives dirs = this.parseDirectives(); + return new InputValueDefinition(InputValueDefinitionEnum.DTD + , des + , name + , type + , dirs + ); } - this.inputValueDefinitions ~= InputValueDefinition.ConstructDT(des, name, type); - return cast(uint)(this.inputValueDefinitions.length - 1); - + return new InputValueDefinition(InputValueDefinitionEnum.DT + , des + , name + , type + ); } auto app = appender!string(); formattedWrite(app, @@ -3627,7 +3857,7 @@ struct Parser { return this.lex.front.type == TokenType.interface_; } - uint parseInterfaceTypeDefinition() { + InterfaceTypeDefinition parseInterfaceTypeDefinition() { try { return this.parseInterfaceTypeDefinitionImpl(); } catch(ParseException e) { @@ -3638,25 +3868,33 @@ struct Parser { } } - uint parseInterfaceTypeDefinitionImpl() { + InterfaceTypeDefinition parseInterfaceTypeDefinitionImpl() { string[] subRules; + subRules = ["NDF", "NF"]; if(this.lex.front.type == TokenType.interface_) { this.lex.popFront(); + subRules = ["NDF", "NF"]; if(this.lex.front.type == TokenType.name) { Token name = this.lex.front; this.lex.popFront(); + subRules = ["NDF"]; if(this.firstDirectives()) { - uint dirs = this.parseDirectives(); + Directives dirs = this.parseDirectives(); + subRules = ["NDF"]; if(this.lex.front.type == TokenType.lcurly) { this.lex.popFront(); + subRules = ["NDF"]; if(this.firstFieldDefinitions()) { - uint fds = this.parseFieldDefinitions(); + FieldDefinitions fds = this.parseFieldDefinitions(); + subRules = ["NDF"]; if(this.lex.front.type == TokenType.rcurly) { this.lex.popFront(); - this.interfaceTypeDefinitions ~= InterfaceTypeDefinition.ConstructNDF(name, dirs, fds); - return cast(uint)(this.interfaceTypeDefinitions.length - 1); - + return new InterfaceTypeDefinition(InterfaceTypeDefinitionEnum.NDF + , name + , dirs + , fds + ); } auto app = appender!string(); formattedWrite(app, @@ -3695,14 +3933,17 @@ struct Parser { } else if(this.lex.front.type == TokenType.lcurly) { this.lex.popFront(); + subRules = ["NF"]; if(this.firstFieldDefinitions()) { - uint fds = this.parseFieldDefinitions(); + FieldDefinitions fds = this.parseFieldDefinitions(); + subRules = ["NF"]; if(this.lex.front.type == TokenType.rcurly) { this.lex.popFront(); - this.interfaceTypeDefinitions ~= InterfaceTypeDefinition.ConstructNF(name, fds); - return cast(uint)(this.interfaceTypeDefinitions.length - 1); - + return new InterfaceTypeDefinition(InterfaceTypeDefinitionEnum.NF + , name + , fds + ); } auto app = appender!string(); formattedWrite(app, @@ -3769,7 +4010,7 @@ struct Parser { return this.lex.front.type == TokenType.union_; } - uint parseUnionTypeDefinition() { + UnionTypeDefinition parseUnionTypeDefinition() { try { return this.parseUnionTypeDefinitionImpl(); } catch(ParseException e) { @@ -3780,23 +4021,30 @@ struct Parser { } } - uint parseUnionTypeDefinitionImpl() { + UnionTypeDefinition parseUnionTypeDefinitionImpl() { string[] subRules; + subRules = ["NDU", "NU"]; if(this.lex.front.type == TokenType.union_) { this.lex.popFront(); + subRules = ["NDU", "NU"]; if(this.lex.front.type == TokenType.name) { Token name = this.lex.front; this.lex.popFront(); + subRules = ["NDU"]; if(this.firstDirectives()) { - uint dirs = this.parseDirectives(); + Directives dirs = this.parseDirectives(); + subRules = ["NDU"]; if(this.lex.front.type == TokenType.equal) { this.lex.popFront(); + subRules = ["NDU"]; if(this.firstUnionMembers()) { - uint um = this.parseUnionMembers(); - - this.unionTypeDefinitions ~= UnionTypeDefinition.ConstructNDU(name, dirs, um); - return cast(uint)(this.unionTypeDefinitions.length - 1); + UnionMembers um = this.parseUnionMembers(); + return new UnionTypeDefinition(UnionTypeDefinitionEnum.NDU + , name + , dirs + , um + ); } auto app = appender!string(); formattedWrite(app, @@ -3823,12 +4071,14 @@ struct Parser { } else if(this.lex.front.type == TokenType.equal) { this.lex.popFront(); + subRules = ["NU"]; if(this.firstUnionMembers()) { - uint um = this.parseUnionMembers(); - - this.unionTypeDefinitions ~= UnionTypeDefinition.ConstructNU(name, um); - return cast(uint)(this.unionTypeDefinitions.length - 1); + UnionMembers um = this.parseUnionMembers(); + return new UnionTypeDefinition(UnionTypeDefinitionEnum.NU + , name + , um + ); } auto app = appender!string(); formattedWrite(app, @@ -3883,7 +4133,7 @@ struct Parser { return this.lex.front.type == TokenType.name; } - uint parseUnionMembers() { + UnionMembers parseUnionMembers() { try { return this.parseUnionMembersImpl(); } catch(ParseException e) { @@ -3894,19 +4144,23 @@ struct Parser { } } - uint parseUnionMembersImpl() { + UnionMembers parseUnionMembersImpl() { string[] subRules; + subRules = ["S", "SF", "SPF"]; if(this.lex.front.type == TokenType.name) { Token name = this.lex.front; this.lex.popFront(); + subRules = ["SPF"]; if(this.lex.front.type == TokenType.pipe) { this.lex.popFront(); + subRules = ["SPF"]; if(this.firstUnionMembers()) { - uint follow = this.parseUnionMembers(); - - this.unionMemberss ~= UnionMembers.ConstructSPF(name, follow); - return cast(uint)(this.unionMemberss.length - 1); + UnionMembers follow = this.parseUnionMembers(); + return new UnionMembers(UnionMembersEnum.SPF + , name + , follow + ); } auto app = appender!string(); formattedWrite(app, @@ -3920,15 +4174,16 @@ struct Parser { ); } else if(this.firstUnionMembers()) { - uint follow = this.parseUnionMembers(); - - this.unionMemberss ~= UnionMembers.ConstructSF(name, follow); - return cast(uint)(this.unionMemberss.length - 1); + UnionMembers follow = this.parseUnionMembers(); + return new UnionMembers(UnionMembersEnum.SF + , name + , follow + ); } - this.unionMemberss ~= UnionMembers.ConstructS(name); - return cast(uint)(this.unionMemberss.length - 1); - + return new UnionMembers(UnionMembersEnum.S + , name + ); } auto app = appender!string(); formattedWrite(app, @@ -3947,7 +4202,7 @@ struct Parser { return this.lex.front.type == TokenType.enum_; } - uint parseEnumTypeDefinition() { + EnumTypeDefinition parseEnumTypeDefinition() { try { return this.parseEnumTypeDefinitionImpl(); } catch(ParseException e) { @@ -3958,25 +4213,33 @@ struct Parser { } } - uint parseEnumTypeDefinitionImpl() { + EnumTypeDefinition parseEnumTypeDefinitionImpl() { string[] subRules; + subRules = ["NDE", "NE"]; if(this.lex.front.type == TokenType.enum_) { this.lex.popFront(); + subRules = ["NDE", "NE"]; if(this.lex.front.type == TokenType.name) { Token name = this.lex.front; this.lex.popFront(); + subRules = ["NDE"]; if(this.firstDirectives()) { - uint dir = this.parseDirectives(); + Directives dir = this.parseDirectives(); + subRules = ["NDE"]; if(this.lex.front.type == TokenType.lcurly) { this.lex.popFront(); + subRules = ["NDE"]; if(this.firstEnumValueDefinitions()) { - uint evds = this.parseEnumValueDefinitions(); + EnumValueDefinitions evds = this.parseEnumValueDefinitions(); + subRules = ["NDE"]; if(this.lex.front.type == TokenType.rcurly) { this.lex.popFront(); - this.enumTypeDefinitions ~= EnumTypeDefinition.ConstructNDE(name, dir, evds); - return cast(uint)(this.enumTypeDefinitions.length - 1); - + return new EnumTypeDefinition(EnumTypeDefinitionEnum.NDE + , name + , dir + , evds + ); } auto app = appender!string(); formattedWrite(app, @@ -4015,14 +4278,17 @@ struct Parser { } else if(this.lex.front.type == TokenType.lcurly) { this.lex.popFront(); + subRules = ["NE"]; if(this.firstEnumValueDefinitions()) { - uint evds = this.parseEnumValueDefinitions(); + EnumValueDefinitions evds = this.parseEnumValueDefinitions(); + subRules = ["NE"]; if(this.lex.front.type == TokenType.rcurly) { this.lex.popFront(); - this.enumTypeDefinitions ~= EnumTypeDefinition.ConstructNE(name, evds); - return cast(uint)(this.enumTypeDefinitions.length - 1); - + return new EnumTypeDefinition(EnumTypeDefinitionEnum.NE + , name + , evds + ); } auto app = appender!string(); formattedWrite(app, @@ -4089,7 +4355,7 @@ struct Parser { return this.firstEnumValueDefinition(); } - uint parseEnumValueDefinitions() { + EnumValueDefinitions parseEnumValueDefinitions() { try { return this.parseEnumValueDefinitionsImpl(); } catch(ParseException e) { @@ -4100,18 +4366,22 @@ struct Parser { } } - uint parseEnumValueDefinitionsImpl() { + EnumValueDefinitions parseEnumValueDefinitionsImpl() { string[] subRules; + subRules = ["D", "DCE", "DE"]; if(this.firstEnumValueDefinition()) { - uint evd = this.parseEnumValueDefinition(); + EnumValueDefinition evd = this.parseEnumValueDefinition(); + subRules = ["DCE"]; if(this.lex.front.type == TokenType.comma) { this.lex.popFront(); + subRules = ["DCE"]; if(this.firstEnumValueDefinitions()) { - uint follow = this.parseEnumValueDefinitions(); - - this.enumValueDefinitionss ~= EnumValueDefinitions.ConstructDCE(evd, follow); - return cast(uint)(this.enumValueDefinitionss.length - 1); + EnumValueDefinitions follow = this.parseEnumValueDefinitions(); + return new EnumValueDefinitions(EnumValueDefinitionsEnum.DCE + , evd + , follow + ); } auto app = appender!string(); formattedWrite(app, @@ -4125,15 +4395,16 @@ struct Parser { ); } else if(this.firstEnumValueDefinitions()) { - uint follow = this.parseEnumValueDefinitions(); - - this.enumValueDefinitionss ~= EnumValueDefinitions.ConstructDE(evd, follow); - return cast(uint)(this.enumValueDefinitionss.length - 1); + EnumValueDefinitions follow = this.parseEnumValueDefinitions(); + return new EnumValueDefinitions(EnumValueDefinitionsEnum.DE + , evd + , follow + ); } - this.enumValueDefinitionss ~= EnumValueDefinitions.ConstructD(evd); - return cast(uint)(this.enumValueDefinitionss.length - 1); - + return new EnumValueDefinitions(EnumValueDefinitionsEnum.D + , evd + ); } auto app = appender!string(); formattedWrite(app, @@ -4153,7 +4424,7 @@ struct Parser { || this.firstDescription(); } - uint parseEnumValueDefinition() { + EnumValueDefinition parseEnumValueDefinition() { try { return this.parseEnumValueDefinitionImpl(); } catch(ParseException e) { @@ -4164,36 +4435,44 @@ struct Parser { } } - uint parseEnumValueDefinitionImpl() { + EnumValueDefinition parseEnumValueDefinitionImpl() { string[] subRules; + subRules = ["E", "ED"]; if(this.lex.front.type == TokenType.name) { Token name = this.lex.front; this.lex.popFront(); + subRules = ["ED"]; if(this.firstDirectives()) { - uint dirs = this.parseDirectives(); - - this.enumValueDefinitions ~= EnumValueDefinition.ConstructED(name, dirs); - return cast(uint)(this.enumValueDefinitions.length - 1); + Directives dirs = this.parseDirectives(); + return new EnumValueDefinition(EnumValueDefinitionEnum.ED + , name + , dirs + ); } - this.enumValueDefinitions ~= EnumValueDefinition.ConstructE(name); - return cast(uint)(this.enumValueDefinitions.length - 1); - + return new EnumValueDefinition(EnumValueDefinitionEnum.E + , name + ); } else if(this.firstDescription()) { - uint des = this.parseDescription(); + Description des = this.parseDescription(); + subRules = ["DE", "DED"]; if(this.lex.front.type == TokenType.name) { Token name = this.lex.front; this.lex.popFront(); + subRules = ["DED"]; if(this.firstDirectives()) { - uint dirs = this.parseDirectives(); - - this.enumValueDefinitions ~= EnumValueDefinition.ConstructDED(des, name, dirs); - return cast(uint)(this.enumValueDefinitions.length - 1); + Directives dirs = this.parseDirectives(); + return new EnumValueDefinition(EnumValueDefinitionEnum.DED + , des + , name + , dirs + ); } - this.enumValueDefinitions ~= EnumValueDefinition.ConstructDE(des, name); - return cast(uint)(this.enumValueDefinitions.length - 1); - + return new EnumValueDefinition(EnumValueDefinitionEnum.DE + , des + , name + ); } auto app = appender!string(); formattedWrite(app, @@ -4224,7 +4503,7 @@ struct Parser { return this.lex.front.type == TokenType.input; } - uint parseInputTypeDefinition() { + InputTypeDefinition parseInputTypeDefinition() { try { return this.parseInputTypeDefinitionImpl(); } catch(ParseException e) { @@ -4235,25 +4514,33 @@ struct Parser { } } - uint parseInputTypeDefinitionImpl() { + InputTypeDefinition parseInputTypeDefinitionImpl() { string[] subRules; + subRules = ["NDE", "NE"]; if(this.lex.front.type == TokenType.input) { this.lex.popFront(); + subRules = ["NDE", "NE"]; if(this.lex.front.type == TokenType.name) { Token name = this.lex.front; this.lex.popFront(); + subRules = ["NDE"]; if(this.firstDirectives()) { - uint dir = this.parseDirectives(); + Directives dir = this.parseDirectives(); + subRules = ["NDE"]; if(this.lex.front.type == TokenType.lcurly) { this.lex.popFront(); + subRules = ["NDE"]; if(this.firstInputValueDefinitions()) { - uint ivds = this.parseInputValueDefinitions(); + InputValueDefinitions ivds = this.parseInputValueDefinitions(); + subRules = ["NDE"]; if(this.lex.front.type == TokenType.rcurly) { this.lex.popFront(); - this.inputTypeDefinitions ~= InputTypeDefinition.ConstructNDE(name, dir, ivds); - return cast(uint)(this.inputTypeDefinitions.length - 1); - + return new InputTypeDefinition(InputTypeDefinitionEnum.NDE + , name + , dir + , ivds + ); } auto app = appender!string(); formattedWrite(app, @@ -4292,14 +4579,17 @@ struct Parser { } else if(this.lex.front.type == TokenType.lcurly) { this.lex.popFront(); + subRules = ["NE"]; if(this.firstInputValueDefinitions()) { - uint ivds = this.parseInputValueDefinitions(); + InputValueDefinitions ivds = this.parseInputValueDefinitions(); + subRules = ["NE"]; if(this.lex.front.type == TokenType.rcurly) { this.lex.popFront(); - this.inputTypeDefinitions ~= InputTypeDefinition.ConstructNE(name, ivds); - return cast(uint)(this.inputTypeDefinitions.length - 1); - + return new InputTypeDefinition(InputTypeDefinitionEnum.NE + , name + , ivds + ); } auto app = appender!string(); formattedWrite(app, @@ -4366,7 +4656,7 @@ struct Parser { return this.lex.front.type == TokenType.extend; } - uint parseTypeExtensionDefinition() { + TypeExtensionDefinition parseTypeExtensionDefinition() { try { return this.parseTypeExtensionDefinitionImpl(); } catch(ParseException e) { @@ -4377,16 +4667,18 @@ struct Parser { } } - uint parseTypeExtensionDefinitionImpl() { + TypeExtensionDefinition parseTypeExtensionDefinitionImpl() { string[] subRules; + subRules = ["O"]; if(this.lex.front.type == TokenType.extend) { this.lex.popFront(); + subRules = ["O"]; if(this.firstObjectTypeDefinition()) { - uint otd = this.parseObjectTypeDefinition(); - - this.typeExtensionDefinitions ~= TypeExtensionDefinition.ConstructO(otd); - return cast(uint)(this.typeExtensionDefinitions.length - 1); + ObjectTypeDefinition otd = this.parseObjectTypeDefinition(); + return new TypeExtensionDefinition(TypeExtensionDefinitionEnum.O + , otd + ); } auto app = appender!string(); formattedWrite(app, @@ -4417,7 +4709,7 @@ struct Parser { return this.lex.front.type == TokenType.directive; } - uint parseDirectiveDefinition() { + DirectiveDefinition parseDirectiveDefinition() { try { return this.parseDirectiveDefinitionImpl(); } catch(ParseException e) { @@ -4428,25 +4720,33 @@ struct Parser { } } - uint parseDirectiveDefinitionImpl() { + DirectiveDefinition parseDirectiveDefinitionImpl() { string[] subRules; + subRules = ["AD", "D"]; if(this.lex.front.type == TokenType.directive) { this.lex.popFront(); + subRules = ["AD", "D"]; if(this.lex.front.type == TokenType.at) { this.lex.popFront(); + subRules = ["AD", "D"]; if(this.lex.front.type == TokenType.name) { Token name = this.lex.front; this.lex.popFront(); + subRules = ["AD"]; if(this.firstArgumentsDefinition()) { - uint ad = this.parseArgumentsDefinition(); + ArgumentsDefinition ad = this.parseArgumentsDefinition(); + subRules = ["AD"]; if(this.lex.front.type == TokenType.on_) { this.lex.popFront(); + subRules = ["AD"]; if(this.firstDirectiveLocations()) { - uint dl = this.parseDirectiveLocations(); - - this.directiveDefinitions ~= DirectiveDefinition.ConstructAD(name, ad, dl); - return cast(uint)(this.directiveDefinitions.length - 1); + DirectiveLocations dl = this.parseDirectiveLocations(); + return new DirectiveDefinition(DirectiveDefinitionEnum.AD + , name + , ad + , dl + ); } auto app = appender!string(); formattedWrite(app, @@ -4473,12 +4773,14 @@ struct Parser { } else if(this.lex.front.type == TokenType.on_) { this.lex.popFront(); + subRules = ["D"]; if(this.firstDirectiveLocations()) { - uint dl = this.parseDirectiveLocations(); - - this.directiveDefinitions ~= DirectiveDefinition.ConstructD(name, dl); - return cast(uint)(this.directiveDefinitions.length - 1); + DirectiveLocations dl = this.parseDirectiveLocations(); + return new DirectiveDefinition(DirectiveDefinitionEnum.D + , name + , dl + ); } auto app = appender!string(); formattedWrite(app, @@ -4545,7 +4847,7 @@ struct Parser { return this.lex.front.type == TokenType.name; } - uint parseDirectiveLocations() { + DirectiveLocations parseDirectiveLocations() { try { return this.parseDirectiveLocationsImpl(); } catch(ParseException e) { @@ -4556,19 +4858,23 @@ struct Parser { } } - uint parseDirectiveLocationsImpl() { + DirectiveLocations parseDirectiveLocationsImpl() { string[] subRules; + subRules = ["N", "NF", "NPF"]; if(this.lex.front.type == TokenType.name) { Token name = this.lex.front; this.lex.popFront(); + subRules = ["NPF"]; if(this.lex.front.type == TokenType.pipe) { this.lex.popFront(); + subRules = ["NPF"]; if(this.firstDirectiveLocations()) { - uint follow = this.parseDirectiveLocations(); - - this.directiveLocationss ~= DirectiveLocations.ConstructNPF(name, follow); - return cast(uint)(this.directiveLocationss.length - 1); + DirectiveLocations follow = this.parseDirectiveLocations(); + return new DirectiveLocations(DirectiveLocationsEnum.NPF + , name + , follow + ); } auto app = appender!string(); formattedWrite(app, @@ -4582,15 +4888,16 @@ struct Parser { ); } else if(this.firstDirectiveLocations()) { - uint follow = this.parseDirectiveLocations(); - - this.directiveLocationss ~= DirectiveLocations.ConstructNF(name, follow); - return cast(uint)(this.directiveLocationss.length - 1); + DirectiveLocations follow = this.parseDirectiveLocations(); + return new DirectiveLocations(DirectiveLocationsEnum.NF + , name + , follow + ); } - this.directiveLocationss ~= DirectiveLocations.ConstructN(name); - return cast(uint)(this.directiveLocationss.length - 1); - + return new DirectiveLocations(DirectiveLocationsEnum.N + , name + ); } auto app = appender!string(); formattedWrite(app, @@ -4609,7 +4916,7 @@ struct Parser { return this.lex.front.type == TokenType.input; } - uint parseInputObjectTypeDefinition() { + InputObjectTypeDefinition parseInputObjectTypeDefinition() { try { return this.parseInputObjectTypeDefinitionImpl(); } catch(ParseException e) { @@ -4620,25 +4927,32 @@ struct Parser { } } - uint parseInputObjectTypeDefinitionImpl() { + InputObjectTypeDefinition parseInputObjectTypeDefinitionImpl() { string[] subRules; + subRules = ["NDI", "NI"]; if(this.lex.front.type == TokenType.input) { this.lex.popFront(); + subRules = ["NDI", "NI"]; if(this.lex.front.type == TokenType.name) { Token name = this.lex.front; this.lex.popFront(); + subRules = ["NDI"]; if(this.firstDirectives()) { - uint dirs = this.parseDirectives(); + Directives dirs = this.parseDirectives(); + subRules = ["NDI"]; if(this.lex.front.type == TokenType.lcurly) { this.lex.popFront(); + subRules = ["NDI"]; if(this.firstInputValueDefinitions()) { this.parseInputValueDefinitions(); + subRules = ["NDI"]; if(this.lex.front.type == TokenType.rcurly) { this.lex.popFront(); - this.inputObjectTypeDefinitions ~= InputObjectTypeDefinition.ConstructNDI(name, dirs); - return cast(uint)(this.inputObjectTypeDefinitions.length - 1); - + return new InputObjectTypeDefinition(InputObjectTypeDefinitionEnum.NDI + , name + , dirs + ); } auto app = appender!string(); formattedWrite(app, @@ -4677,14 +4991,16 @@ struct Parser { } else if(this.lex.front.type == TokenType.lcurly) { this.lex.popFront(); + subRules = ["NI"]; if(this.firstInputValueDefinitions()) { this.parseInputValueDefinitions(); + subRules = ["NI"]; if(this.lex.front.type == TokenType.rcurly) { this.lex.popFront(); - this.inputObjectTypeDefinitions ~= InputObjectTypeDefinition.ConstructNI(name); - return cast(uint)(this.inputObjectTypeDefinitions.length - 1); - + return new InputObjectTypeDefinition(InputObjectTypeDefinitionEnum.NI + , name + ); } auto app = appender!string(); formattedWrite(app, @@ -4751,7 +5067,7 @@ struct Parser { return this.lex.front.type == TokenType.stringValue; } - uint parseDescription() { + Description parseDescription() { try { return this.parseDescriptionImpl(); } catch(ParseException e) { @@ -4762,15 +5078,16 @@ struct Parser { } } - uint parseDescriptionImpl() { + Description parseDescriptionImpl() { string[] subRules; + subRules = ["S"]; if(this.lex.front.type == TokenType.stringValue) { Token tok = this.lex.front; this.lex.popFront(); - this.descriptions ~= Description.ConstructS(tok); - return cast(uint)(this.descriptions.length - 1); - + return new Description(DescriptionEnum.S + , tok + ); } auto app = appender!string(); formattedWrite(app, diff --git a/source/graphql/starwars/introspection.d b/source/graphql/starwars/introspection.d index d37e41ef..d1c2cefb 100644 --- a/source/graphql/starwars/introspection.d +++ b/source/graphql/starwars/introspection.d @@ -1,7 +1,5 @@ module graphql.starwars.introspection; -__EOF__ - import std.typecons : Nullable, nullable; import std.format : format; import std.stdio; diff --git a/source/graphql/starwars/query.d b/source/graphql/starwars/query.d index 0e7ad8ab..90b45a6f 100644 --- a/source/graphql/starwars/query.d +++ b/source/graphql/starwars/query.d @@ -1,7 +1,5 @@ module graphql.starwars.query; -__EOF__ - import std.typecons : Nullable, nullable; import std.format : format; import std.stdio; diff --git a/source/graphql/starwars/validation.d b/source/graphql/starwars/validation.d index 1b98edaf..71e6298d 100644 --- a/source/graphql/starwars/validation.d +++ b/source/graphql/starwars/validation.d @@ -1,7 +1,5 @@ module graphql.starwars.validation; -__EOF__ - import std.typecons : Nullable, nullable; import std.format : format; import std.exception; diff --git a/source/graphql/treevisitor.d b/source/graphql/treevisitor.d index 3f8779bc..a438da0e 100644 --- a/source/graphql/treevisitor.d +++ b/source/graphql/treevisitor.d @@ -5,8 +5,6 @@ import graphql.ast; import graphql.visitor; import graphql.tokenmodule; -__EOF__ - class TreeVisitor : ConstVisitor { @safe : diff --git a/source/graphql/validation/querybased.d b/source/graphql/validation/querybased.d index 0827afd9..ea7e602e 100644 --- a/source/graphql/validation/querybased.d +++ b/source/graphql/validation/querybased.d @@ -1,7 +1,5 @@ module graphql.validation.querybased; -__EOF__ - import std.array : array, back, empty, popBack; import std.algorithm.searching : canFind; import std.algorithm.sorting : sort; diff --git a/source/graphql/validation/schemabased.d b/source/graphql/validation/schemabased.d index 90cf2c0d..d19c5a12 100644 --- a/source/graphql/validation/schemabased.d +++ b/source/graphql/validation/schemabased.d @@ -1,7 +1,5 @@ module graphql.validation.schemabased; -__EOF__ - import std.algorithm.iteration : map; import std.algorithm.searching : canFind, find, startsWith, endsWith; import std.array : array, back, empty, front, popBack; diff --git a/source/graphql/visitor.d b/source/graphql/visitor.d index 27b851bc..7b8f64ef 100644 --- a/source/graphql/visitor.d +++ b/source/graphql/visitor.d @@ -1,142 +1,141 @@ module graphql.visitor; import graphql.ast; -import graphql.parser; import graphql.tokenmodule; -class Visitor { +class Visitor : ConstVisitor { @safe : - Parser* parser; + alias accept = ConstVisitor.accept; - this(Parser* parser) { - this.parser = parser; - } + alias enter = ConstVisitor.enter; + + alias exit = ConstVisitor.exit; - void enter(ref Document obj) {} - void exit(ref Document obj) {} + void enter(Document obj) {} + void exit(Document obj) {} - void accept(ref Document obj) { + void accept(Document obj) { enter(obj); final switch(obj.ruleSelection) { case DocumentEnum.Defi: - this.accept(this.parser.definitionss[obj.defsIdx]); + obj.defs.visit(this); break; } exit(obj); } - void enter(ref Definitions obj) {} - void exit(ref Definitions obj) {} + void enter(Definitions obj) {} + void exit(Definitions obj) {} - void accept(ref Definitions obj) { + void accept(Definitions obj) { enter(obj); final switch(obj.ruleSelection) { case DefinitionsEnum.Def: - this.accept(this.parser.definitions[obj.defIdx]); + obj.def.visit(this); break; case DefinitionsEnum.Defs: - this.accept(this.parser.definitions[obj.defIdx]); - this.accept(this.parser.definitionss[obj.followIdx]); + obj.def.visit(this); + obj.follow.visit(this); break; } exit(obj); } - void enter(ref Definition obj) {} - void exit(ref Definition obj) {} + void enter(Definition obj) {} + void exit(Definition obj) {} - void accept(ref Definition obj) { + void accept(Definition obj) { enter(obj); final switch(obj.ruleSelection) { case DefinitionEnum.O: - this.accept(this.parser.operationDefinitions[obj.opIdx]); + obj.op.visit(this); break; case DefinitionEnum.F: - this.accept(this.parser.fragmentDefinitions[obj.fragIdx]); + obj.frag.visit(this); break; case DefinitionEnum.T: - this.accept(this.parser.typeSystemDefinitions[obj.typeIdx]); + obj.type.visit(this); break; } exit(obj); } - void enter(ref OperationDefinition obj) {} - void exit(ref OperationDefinition obj) {} + void enter(OperationDefinition obj) {} + void exit(OperationDefinition obj) {} - void accept(ref OperationDefinition obj) { + void accept(OperationDefinition obj) { enter(obj); final switch(obj.ruleSelection) { case OperationDefinitionEnum.SelSet: - this.accept(this.parser.selectionSets[obj.ssIdx]); + obj.ss.visit(this); break; case OperationDefinitionEnum.OT_N_VD: - this.accept(this.parser.operationTypes[obj.otIdx]); + obj.ot.visit(this); obj.name.visit(this); - this.accept(this.parser.variableDefinitionss[obj.vdIdx]); - this.accept(this.parser.directivess[obj.dIdx]); - this.accept(this.parser.selectionSets[obj.ssIdx]); + obj.vd.visit(this); + obj.d.visit(this); + obj.ss.visit(this); break; case OperationDefinitionEnum.OT_N_V: - this.accept(this.parser.operationTypes[obj.otIdx]); + obj.ot.visit(this); obj.name.visit(this); - this.accept(this.parser.variableDefinitionss[obj.vdIdx]); - this.accept(this.parser.selectionSets[obj.ssIdx]); + obj.vd.visit(this); + obj.ss.visit(this); break; case OperationDefinitionEnum.OT_N_D: - this.accept(this.parser.operationTypes[obj.otIdx]); + obj.ot.visit(this); obj.name.visit(this); - this.accept(this.parser.directivess[obj.dIdx]); - this.accept(this.parser.selectionSets[obj.ssIdx]); + obj.d.visit(this); + obj.ss.visit(this); break; case OperationDefinitionEnum.OT_N: - this.accept(this.parser.operationTypes[obj.otIdx]); + obj.ot.visit(this); obj.name.visit(this); - this.accept(this.parser.selectionSets[obj.ssIdx]); + obj.ss.visit(this); break; case OperationDefinitionEnum.OT_VD: - this.accept(this.parser.operationTypes[obj.otIdx]); - this.accept(this.parser.variableDefinitionss[obj.vdIdx]); - this.accept(this.parser.directivess[obj.dIdx]); - this.accept(this.parser.selectionSets[obj.ssIdx]); + obj.ot.visit(this); + obj.vd.visit(this); + obj.d.visit(this); + obj.ss.visit(this); break; case OperationDefinitionEnum.OT_V: - this.accept(this.parser.operationTypes[obj.otIdx]); - this.accept(this.parser.variableDefinitionss[obj.vdIdx]); - this.accept(this.parser.selectionSets[obj.ssIdx]); + obj.ot.visit(this); + obj.vd.visit(this); + obj.ss.visit(this); break; case OperationDefinitionEnum.OT_D: - this.accept(this.parser.operationTypes[obj.otIdx]); - this.accept(this.parser.directivess[obj.dIdx]); - this.accept(this.parser.selectionSets[obj.ssIdx]); + obj.ot.visit(this); + obj.d.visit(this); + obj.ss.visit(this); break; case OperationDefinitionEnum.OT: - this.accept(this.parser.operationTypes[obj.otIdx]); - this.accept(this.parser.selectionSets[obj.ssIdx]); + obj.ot.visit(this); + obj.ss.visit(this); break; } exit(obj); } - void enter(ref SelectionSet obj) {} - void exit(ref SelectionSet obj) {} + void enter(SelectionSet obj) {} + void exit(SelectionSet obj) {} - void accept(ref SelectionSet obj) { + void accept(SelectionSet obj) { enter(obj); final switch(obj.ruleSelection) { case SelectionSetEnum.SS: - this.accept(this.parser.selectionss[obj.selIdx]); + obj.sel.visit(this); break; } exit(obj); } - void enter(ref OperationType obj) {} - void exit(ref OperationType obj) {} + void enter(OperationType obj) {} + void exit(OperationType obj) {} - void accept(ref OperationType obj) { + void accept(OperationType obj) { enter(obj); final switch(obj.ruleSelection) { case OperationTypeEnum.Query: @@ -152,55 +151,55 @@ class Visitor { exit(obj); } - void enter(ref Selections obj) {} - void exit(ref Selections obj) {} + void enter(Selections obj) {} + void exit(Selections obj) {} - void accept(ref Selections obj) { + void accept(Selections obj) { enter(obj); final switch(obj.ruleSelection) { case SelectionsEnum.Sel: - this.accept(this.parser.selections[obj.selIdx]); + obj.sel.visit(this); break; case SelectionsEnum.Sels: - this.accept(this.parser.selections[obj.selIdx]); - this.accept(this.parser.selectionss[obj.followIdx]); + obj.sel.visit(this); + obj.follow.visit(this); break; case SelectionsEnum.Selsc: - this.accept(this.parser.selections[obj.selIdx]); - this.accept(this.parser.selectionss[obj.followIdx]); + obj.sel.visit(this); + obj.follow.visit(this); break; } exit(obj); } - void enter(ref Selection obj) {} - void exit(ref Selection obj) {} + void enter(Selection obj) {} + void exit(Selection obj) {} - void accept(ref Selection obj) { + void accept(Selection obj) { enter(obj); final switch(obj.ruleSelection) { case SelectionEnum.Field: - this.accept(this.parser.fields[obj.fieldIdx]); + obj.field.visit(this); break; case SelectionEnum.Spread: - this.accept(this.parser.fragmentSpreads[obj.fragIdx]); + obj.frag.visit(this); break; case SelectionEnum.IFrag: - this.accept(this.parser.inlineFragments[obj.ifragIdx]); + obj.ifrag.visit(this); break; } exit(obj); } - void enter(ref FragmentSpread obj) {} - void exit(ref FragmentSpread obj) {} + void enter(FragmentSpread obj) {} + void exit(FragmentSpread obj) {} - void accept(ref FragmentSpread obj) { + void accept(FragmentSpread obj) { enter(obj); final switch(obj.ruleSelection) { case FragmentSpreadEnum.FD: obj.name.visit(this); - this.accept(this.parser.directivess[obj.dirsIdx]); + obj.dirs.visit(this); break; case FragmentSpreadEnum.F: obj.name.visit(this); @@ -209,82 +208,82 @@ class Visitor { exit(obj); } - void enter(ref InlineFragment obj) {} - void exit(ref InlineFragment obj) {} + void enter(InlineFragment obj) {} + void exit(InlineFragment obj) {} - void accept(ref InlineFragment obj) { + void accept(InlineFragment obj) { enter(obj); final switch(obj.ruleSelection) { case InlineFragmentEnum.TDS: obj.tc.visit(this); - this.accept(this.parser.directivess[obj.dirsIdx]); - this.accept(this.parser.selectionSets[obj.ssIdx]); + obj.dirs.visit(this); + obj.ss.visit(this); break; case InlineFragmentEnum.TS: obj.tc.visit(this); - this.accept(this.parser.selectionSets[obj.ssIdx]); + obj.ss.visit(this); break; case InlineFragmentEnum.DS: - this.accept(this.parser.directivess[obj.dirsIdx]); - this.accept(this.parser.selectionSets[obj.ssIdx]); + obj.dirs.visit(this); + obj.ss.visit(this); break; case InlineFragmentEnum.S: - this.accept(this.parser.selectionSets[obj.ssIdx]); + obj.ss.visit(this); break; } exit(obj); } - void enter(ref Field obj) {} - void exit(ref Field obj) {} + void enter(Field obj) {} + void exit(Field obj) {} - void accept(ref Field obj) { + void accept(Field obj) { enter(obj); final switch(obj.ruleSelection) { case FieldEnum.FADS: - this.accept(this.parser.fieldNames[obj.nameIdx]); - this.accept(this.parser.argumentss[obj.argsIdx]); - this.accept(this.parser.directivess[obj.dirsIdx]); - this.accept(this.parser.selectionSets[obj.ssIdx]); + obj.name.visit(this); + obj.args.visit(this); + obj.dirs.visit(this); + obj.ss.visit(this); break; case FieldEnum.FAS: - this.accept(this.parser.fieldNames[obj.nameIdx]); - this.accept(this.parser.argumentss[obj.argsIdx]); - this.accept(this.parser.selectionSets[obj.ssIdx]); + obj.name.visit(this); + obj.args.visit(this); + obj.ss.visit(this); break; case FieldEnum.FAD: - this.accept(this.parser.fieldNames[obj.nameIdx]); - this.accept(this.parser.argumentss[obj.argsIdx]); - this.accept(this.parser.directivess[obj.dirsIdx]); + obj.name.visit(this); + obj.args.visit(this); + obj.dirs.visit(this); break; case FieldEnum.FDS: - this.accept(this.parser.fieldNames[obj.nameIdx]); - this.accept(this.parser.directivess[obj.dirsIdx]); - this.accept(this.parser.selectionSets[obj.ssIdx]); + obj.name.visit(this); + obj.dirs.visit(this); + obj.ss.visit(this); break; case FieldEnum.FS: - this.accept(this.parser.fieldNames[obj.nameIdx]); - this.accept(this.parser.selectionSets[obj.ssIdx]); + obj.name.visit(this); + obj.ss.visit(this); break; case FieldEnum.FD: - this.accept(this.parser.fieldNames[obj.nameIdx]); - this.accept(this.parser.directivess[obj.dirsIdx]); + obj.name.visit(this); + obj.dirs.visit(this); break; case FieldEnum.FA: - this.accept(this.parser.fieldNames[obj.nameIdx]); - this.accept(this.parser.argumentss[obj.argsIdx]); + obj.name.visit(this); + obj.args.visit(this); break; case FieldEnum.F: - this.accept(this.parser.fieldNames[obj.nameIdx]); + obj.name.visit(this); break; } exit(obj); } - void enter(ref FieldName obj) {} - void exit(ref FieldName obj) {} + void enter(FieldName obj) {} + void exit(FieldName obj) {} - void accept(ref FieldName obj) { + void accept(FieldName obj) { enter(obj); final switch(obj.ruleSelection) { case FieldNameEnum.A: @@ -298,14 +297,14 @@ class Visitor { exit(obj); } - void enter(ref Arguments obj) {} - void exit(ref Arguments obj) {} + void enter(Arguments obj) {} + void exit(Arguments obj) {} - void accept(ref Arguments obj) { + void accept(Arguments obj) { enter(obj); final switch(obj.ruleSelection) { case ArgumentsEnum.List: - this.accept(this.parser.argumentLists[obj.argIdx]); + obj.arg.visit(this); break; case ArgumentsEnum.Empty: break; @@ -313,88 +312,88 @@ class Visitor { exit(obj); } - void enter(ref ArgumentList obj) {} - void exit(ref ArgumentList obj) {} + void enter(ArgumentList obj) {} + void exit(ArgumentList obj) {} - void accept(ref ArgumentList obj) { + void accept(ArgumentList obj) { enter(obj); final switch(obj.ruleSelection) { case ArgumentListEnum.A: - this.accept(this.parser.arguments[obj.argIdx]); + obj.arg.visit(this); break; case ArgumentListEnum.ACS: - this.accept(this.parser.arguments[obj.argIdx]); - this.accept(this.parser.argumentLists[obj.followIdx]); + obj.arg.visit(this); + obj.follow.visit(this); break; case ArgumentListEnum.AS: - this.accept(this.parser.arguments[obj.argIdx]); - this.accept(this.parser.argumentLists[obj.followIdx]); + obj.arg.visit(this); + obj.follow.visit(this); break; } exit(obj); } - void enter(ref Argument obj) {} - void exit(ref Argument obj) {} + void enter(Argument obj) {} + void exit(Argument obj) {} - void accept(ref Argument obj) { + void accept(Argument obj) { enter(obj); final switch(obj.ruleSelection) { case ArgumentEnum.Name: obj.name.visit(this); - this.accept(this.parser.valueOrVariables[obj.vvIdx]); + obj.vv.visit(this); break; } exit(obj); } - void enter(ref FragmentDefinition obj) {} - void exit(ref FragmentDefinition obj) {} + void enter(FragmentDefinition obj) {} + void exit(FragmentDefinition obj) {} - void accept(ref FragmentDefinition obj) { + void accept(FragmentDefinition obj) { enter(obj); final switch(obj.ruleSelection) { case FragmentDefinitionEnum.FTDS: obj.name.visit(this); obj.tc.visit(this); - this.accept(this.parser.directivess[obj.dirsIdx]); - this.accept(this.parser.selectionSets[obj.ssIdx]); + obj.dirs.visit(this); + obj.ss.visit(this); break; case FragmentDefinitionEnum.FTS: obj.name.visit(this); obj.tc.visit(this); - this.accept(this.parser.selectionSets[obj.ssIdx]); + obj.ss.visit(this); break; } exit(obj); } - void enter(ref Directives obj) {} - void exit(ref Directives obj) {} + void enter(Directives obj) {} + void exit(Directives obj) {} - void accept(ref Directives obj) { + void accept(Directives obj) { enter(obj); final switch(obj.ruleSelection) { case DirectivesEnum.Dir: - this.accept(this.parser.directives[obj.dirIdx]); + obj.dir.visit(this); break; case DirectivesEnum.Dirs: - this.accept(this.parser.directives[obj.dirIdx]); - this.accept(this.parser.directivess[obj.followIdx]); + obj.dir.visit(this); + obj.follow.visit(this); break; } exit(obj); } - void enter(ref Directive obj) {} - void exit(ref Directive obj) {} + void enter(Directive obj) {} + void exit(Directive obj) {} - void accept(ref Directive obj) { + void accept(Directive obj) { enter(obj); final switch(obj.ruleSelection) { case DirectiveEnum.NArg: obj.name.visit(this); - this.accept(this.parser.argumentss[obj.argIdx]); + obj.arg.visit(this); break; case DirectiveEnum.N: obj.name.visit(this); @@ -403,65 +402,65 @@ class Visitor { exit(obj); } - void enter(ref VariableDefinitions obj) {} - void exit(ref VariableDefinitions obj) {} + void enter(VariableDefinitions obj) {} + void exit(VariableDefinitions obj) {} - void accept(ref VariableDefinitions obj) { + void accept(VariableDefinitions obj) { enter(obj); final switch(obj.ruleSelection) { case VariableDefinitionsEnum.Empty: break; case VariableDefinitionsEnum.Vars: - this.accept(this.parser.variableDefinitionLists[obj.varsIdx]); + obj.vars.visit(this); break; } exit(obj); } - void enter(ref VariableDefinitionList obj) {} - void exit(ref VariableDefinitionList obj) {} + void enter(VariableDefinitionList obj) {} + void exit(VariableDefinitionList obj) {} - void accept(ref VariableDefinitionList obj) { + void accept(VariableDefinitionList obj) { enter(obj); final switch(obj.ruleSelection) { case VariableDefinitionListEnum.V: - this.accept(this.parser.variableDefinitions[obj.varIdx]); + obj.var.visit(this); break; case VariableDefinitionListEnum.VCF: - this.accept(this.parser.variableDefinitions[obj.varIdx]); - this.accept(this.parser.variableDefinitionLists[obj.followIdx]); + obj.var.visit(this); + obj.follow.visit(this); break; case VariableDefinitionListEnum.VF: - this.accept(this.parser.variableDefinitions[obj.varIdx]); - this.accept(this.parser.variableDefinitionLists[obj.followIdx]); + obj.var.visit(this); + obj.follow.visit(this); break; } exit(obj); } - void enter(ref VariableDefinition obj) {} - void exit(ref VariableDefinition obj) {} + void enter(VariableDefinition obj) {} + void exit(VariableDefinition obj) {} - void accept(ref VariableDefinition obj) { + void accept(VariableDefinition obj) { enter(obj); final switch(obj.ruleSelection) { case VariableDefinitionEnum.VarD: - this.accept(this.parser.variables[obj.varIdx]); - this.accept(this.parser.types[obj.typeIdx]); - this.accept(this.parser.defaultValues[obj.dvalueIdx]); + obj.var.visit(this); + obj.type.visit(this); + obj.dvalue.visit(this); break; case VariableDefinitionEnum.Var: - this.accept(this.parser.variables[obj.varIdx]); - this.accept(this.parser.types[obj.typeIdx]); + obj.var.visit(this); + obj.type.visit(this); break; } exit(obj); } - void enter(ref Variable obj) {} - void exit(ref Variable obj) {} + void enter(Variable obj) {} + void exit(Variable obj) {} - void accept(ref Variable obj) { + void accept(Variable obj) { enter(obj); final switch(obj.ruleSelection) { case VariableEnum.Var: @@ -471,39 +470,39 @@ class Visitor { exit(obj); } - void enter(ref DefaultValue obj) {} - void exit(ref DefaultValue obj) {} + void enter(DefaultValue obj) {} + void exit(DefaultValue obj) {} - void accept(ref DefaultValue obj) { + void accept(DefaultValue obj) { enter(obj); final switch(obj.ruleSelection) { case DefaultValueEnum.DV: - this.accept(this.parser.values[obj.valueIdx]); + obj.value.visit(this); break; } exit(obj); } - void enter(ref ValueOrVariable obj) {} - void exit(ref ValueOrVariable obj) {} + void enter(ValueOrVariable obj) {} + void exit(ValueOrVariable obj) {} - void accept(ref ValueOrVariable obj) { + void accept(ValueOrVariable obj) { enter(obj); final switch(obj.ruleSelection) { case ValueOrVariableEnum.Val: - this.accept(this.parser.values[obj.valIdx]); + obj.val.visit(this); break; case ValueOrVariableEnum.Var: - this.accept(this.parser.variables[obj.varIdx]); + obj.var.visit(this); break; } exit(obj); } - void enter(ref Value obj) {} - void exit(ref Value obj) {} + void enter(Value obj) {} + void exit(Value obj) {} - void accept(ref Value obj) { + void accept(Value obj) { enter(obj); final switch(obj.ruleSelection) { case ValueEnum.STR: @@ -522,10 +521,10 @@ class Visitor { obj.tok.visit(this); break; case ValueEnum.ARR: - this.accept(this.parser.arrays[obj.arrIdx]); + obj.arr.visit(this); break; case ValueEnum.O: - this.accept(this.parser.objectTypes[obj.objIdx]); + obj.obj.visit(this); break; case ValueEnum.E: obj.tok.visit(this); @@ -537,241 +536,241 @@ class Visitor { exit(obj); } - void enter(ref Type obj) {} - void exit(ref Type obj) {} + void enter(Type obj) {} + void exit(Type obj) {} - void accept(ref Type obj) { + void accept(Type obj) { enter(obj); final switch(obj.ruleSelection) { case TypeEnum.TN: obj.tname.visit(this); break; case TypeEnum.LN: - this.accept(this.parser.listTypes[obj.listIdx]); + obj.list.visit(this); break; case TypeEnum.T: obj.tname.visit(this); break; case TypeEnum.L: - this.accept(this.parser.listTypes[obj.listIdx]); + obj.list.visit(this); break; } exit(obj); } - void enter(ref ListType obj) {} - void exit(ref ListType obj) {} + void enter(ListType obj) {} + void exit(ListType obj) {} - void accept(ref ListType obj) { + void accept(ListType obj) { enter(obj); final switch(obj.ruleSelection) { case ListTypeEnum.T: - this.accept(this.parser.types[obj.typeIdx]); + obj.type.visit(this); break; } exit(obj); } - void enter(ref Values obj) {} - void exit(ref Values obj) {} + void enter(Values obj) {} + void exit(Values obj) {} - void accept(ref Values obj) { + void accept(Values obj) { enter(obj); final switch(obj.ruleSelection) { case ValuesEnum.Val: - this.accept(this.parser.values[obj.valIdx]); + obj.val.visit(this); break; case ValuesEnum.Vals: - this.accept(this.parser.values[obj.valIdx]); - this.accept(this.parser.valuess[obj.followIdx]); + obj.val.visit(this); + obj.follow.visit(this); break; case ValuesEnum.ValsNoComma: - this.accept(this.parser.values[obj.valIdx]); - this.accept(this.parser.valuess[obj.followIdx]); + obj.val.visit(this); + obj.follow.visit(this); break; } exit(obj); } - void enter(ref Array obj) {} - void exit(ref Array obj) {} + void enter(Array obj) {} + void exit(Array obj) {} - void accept(ref Array obj) { + void accept(Array obj) { enter(obj); final switch(obj.ruleSelection) { case ArrayEnum.Empty: break; case ArrayEnum.Value: - this.accept(this.parser.valuess[obj.valsIdx]); + obj.vals.visit(this); break; } exit(obj); } - void enter(ref ObjectValues obj) {} - void exit(ref ObjectValues obj) {} + void enter(ObjectValues obj) {} + void exit(ObjectValues obj) {} - void accept(ref ObjectValues obj) { + void accept(ObjectValues obj) { enter(obj); final switch(obj.ruleSelection) { case ObjectValuesEnum.V: obj.name.visit(this); - this.accept(this.parser.valueOrVariables[obj.valIdx]); + obj.val.visit(this); break; case ObjectValuesEnum.Vsc: obj.name.visit(this); - this.accept(this.parser.valueOrVariables[obj.valIdx]); - this.accept(this.parser.objectValuess[obj.followIdx]); + obj.val.visit(this); + obj.follow.visit(this); break; case ObjectValuesEnum.Vs: obj.name.visit(this); - this.accept(this.parser.valueOrVariables[obj.valIdx]); - this.accept(this.parser.objectValuess[obj.followIdx]); + obj.val.visit(this); + obj.follow.visit(this); break; } exit(obj); } - void enter(ref ObjectType obj) {} - void exit(ref ObjectType obj) {} + void enter(ObjectType obj) {} + void exit(ObjectType obj) {} - void accept(ref ObjectType obj) { + void accept(ObjectType obj) { enter(obj); final switch(obj.ruleSelection) { case ObjectTypeEnum.Var: - this.accept(this.parser.objectValuess[obj.valsIdx]); + obj.vals.visit(this); break; } exit(obj); } - void enter(ref TypeSystemDefinition obj) {} - void exit(ref TypeSystemDefinition obj) {} + void enter(TypeSystemDefinition obj) {} + void exit(TypeSystemDefinition obj) {} - void accept(ref TypeSystemDefinition obj) { + void accept(TypeSystemDefinition obj) { enter(obj); final switch(obj.ruleSelection) { case TypeSystemDefinitionEnum.S: - this.accept(this.parser.schemaDefinitions[obj.schIdx]); + obj.sch.visit(this); break; case TypeSystemDefinitionEnum.T: - this.accept(this.parser.typeDefinitions[obj.tdIdx]); + obj.td.visit(this); break; case TypeSystemDefinitionEnum.TE: - this.accept(this.parser.typeExtensionDefinitions[obj.tedIdx]); + obj.ted.visit(this); break; case TypeSystemDefinitionEnum.D: - this.accept(this.parser.directiveDefinitions[obj.ddIdx]); + obj.dd.visit(this); break; case TypeSystemDefinitionEnum.DS: - this.accept(this.parser.descriptions[obj.desIdx]); - this.accept(this.parser.schemaDefinitions[obj.schIdx]); + obj.des.visit(this); + obj.sch.visit(this); break; case TypeSystemDefinitionEnum.DT: - this.accept(this.parser.descriptions[obj.desIdx]); - this.accept(this.parser.typeDefinitions[obj.tdIdx]); + obj.des.visit(this); + obj.td.visit(this); break; case TypeSystemDefinitionEnum.DTE: - this.accept(this.parser.descriptions[obj.desIdx]); - this.accept(this.parser.typeExtensionDefinitions[obj.tedIdx]); + obj.des.visit(this); + obj.ted.visit(this); break; case TypeSystemDefinitionEnum.DD: - this.accept(this.parser.descriptions[obj.desIdx]); - this.accept(this.parser.directiveDefinitions[obj.ddIdx]); + obj.des.visit(this); + obj.dd.visit(this); break; } exit(obj); } - void enter(ref TypeDefinition obj) {} - void exit(ref TypeDefinition obj) {} + void enter(TypeDefinition obj) {} + void exit(TypeDefinition obj) {} - void accept(ref TypeDefinition obj) { + void accept(TypeDefinition obj) { enter(obj); final switch(obj.ruleSelection) { case TypeDefinitionEnum.S: - this.accept(this.parser.scalarTypeDefinitions[obj.stdIdx]); + obj.std.visit(this); break; case TypeDefinitionEnum.O: - this.accept(this.parser.objectTypeDefinitions[obj.otdIdx]); + obj.otd.visit(this); break; case TypeDefinitionEnum.I: - this.accept(this.parser.interfaceTypeDefinitions[obj.itdIdx]); + obj.itd.visit(this); break; case TypeDefinitionEnum.U: - this.accept(this.parser.unionTypeDefinitions[obj.utdIdx]); + obj.utd.visit(this); break; case TypeDefinitionEnum.E: - this.accept(this.parser.enumTypeDefinitions[obj.etdIdx]); + obj.etd.visit(this); break; case TypeDefinitionEnum.IO: - this.accept(this.parser.inputObjectTypeDefinitions[obj.iodIdx]); + obj.iod.visit(this); break; } exit(obj); } - void enter(ref SchemaDefinition obj) {} - void exit(ref SchemaDefinition obj) {} + void enter(SchemaDefinition obj) {} + void exit(SchemaDefinition obj) {} - void accept(ref SchemaDefinition obj) { + void accept(SchemaDefinition obj) { enter(obj); final switch(obj.ruleSelection) { case SchemaDefinitionEnum.DO: - this.accept(this.parser.directivess[obj.dirIdx]); - this.accept(this.parser.operationTypeDefinitionss[obj.otdsIdx]); + obj.dir.visit(this); + obj.otds.visit(this); break; case SchemaDefinitionEnum.O: - this.accept(this.parser.operationTypeDefinitionss[obj.otdsIdx]); + obj.otds.visit(this); break; } exit(obj); } - void enter(ref OperationTypeDefinitions obj) {} - void exit(ref OperationTypeDefinitions obj) {} + void enter(OperationTypeDefinitions obj) {} + void exit(OperationTypeDefinitions obj) {} - void accept(ref OperationTypeDefinitions obj) { + void accept(OperationTypeDefinitions obj) { enter(obj); final switch(obj.ruleSelection) { case OperationTypeDefinitionsEnum.O: - this.accept(this.parser.operationTypeDefinitions[obj.otdIdx]); + obj.otd.visit(this); break; case OperationTypeDefinitionsEnum.OCS: - this.accept(this.parser.operationTypeDefinitions[obj.otdIdx]); - this.accept(this.parser.operationTypeDefinitionss[obj.followIdx]); + obj.otd.visit(this); + obj.follow.visit(this); break; case OperationTypeDefinitionsEnum.OS: - this.accept(this.parser.operationTypeDefinitions[obj.otdIdx]); - this.accept(this.parser.operationTypeDefinitionss[obj.followIdx]); + obj.otd.visit(this); + obj.follow.visit(this); break; } exit(obj); } - void enter(ref OperationTypeDefinition obj) {} - void exit(ref OperationTypeDefinition obj) {} + void enter(OperationTypeDefinition obj) {} + void exit(OperationTypeDefinition obj) {} - void accept(ref OperationTypeDefinition obj) { + void accept(OperationTypeDefinition obj) { enter(obj); final switch(obj.ruleSelection) { case OperationTypeDefinitionEnum.O: - this.accept(this.parser.operationTypes[obj.otIdx]); + obj.ot.visit(this); obj.nt.visit(this); break; } exit(obj); } - void enter(ref ScalarTypeDefinition obj) {} - void exit(ref ScalarTypeDefinition obj) {} + void enter(ScalarTypeDefinition obj) {} + void exit(ScalarTypeDefinition obj) {} - void accept(ref ScalarTypeDefinition obj) { + void accept(ScalarTypeDefinition obj) { enter(obj); final switch(obj.ruleSelection) { case ScalarTypeDefinitionEnum.D: obj.name.visit(this); - this.accept(this.parser.directivess[obj.dirIdx]); + obj.dir.visit(this); break; case ScalarTypeDefinitionEnum.S: obj.name.visit(this); @@ -780,128 +779,128 @@ class Visitor { exit(obj); } - void enter(ref ObjectTypeDefinition obj) {} - void exit(ref ObjectTypeDefinition obj) {} + void enter(ObjectTypeDefinition obj) {} + void exit(ObjectTypeDefinition obj) {} - void accept(ref ObjectTypeDefinition obj) { + void accept(ObjectTypeDefinition obj) { enter(obj); final switch(obj.ruleSelection) { case ObjectTypeDefinitionEnum.ID: obj.name.visit(this); - this.accept(this.parser.implementsInterfacess[obj.iiIdx]); - this.accept(this.parser.directivess[obj.dirIdx]); - this.accept(this.parser.fieldDefinitionss[obj.fdsIdx]); + obj.ii.visit(this); + obj.dir.visit(this); + obj.fds.visit(this); break; case ObjectTypeDefinitionEnum.I: obj.name.visit(this); - this.accept(this.parser.implementsInterfacess[obj.iiIdx]); - this.accept(this.parser.fieldDefinitionss[obj.fdsIdx]); + obj.ii.visit(this); + obj.fds.visit(this); break; case ObjectTypeDefinitionEnum.D: obj.name.visit(this); - this.accept(this.parser.directivess[obj.dirIdx]); - this.accept(this.parser.fieldDefinitionss[obj.fdsIdx]); + obj.dir.visit(this); + obj.fds.visit(this); break; case ObjectTypeDefinitionEnum.F: obj.name.visit(this); - this.accept(this.parser.fieldDefinitionss[obj.fdsIdx]); + obj.fds.visit(this); break; } exit(obj); } - void enter(ref FieldDefinitions obj) {} - void exit(ref FieldDefinitions obj) {} + void enter(FieldDefinitions obj) {} + void exit(FieldDefinitions obj) {} - void accept(ref FieldDefinitions obj) { + void accept(FieldDefinitions obj) { enter(obj); final switch(obj.ruleSelection) { case FieldDefinitionsEnum.F: - this.accept(this.parser.fieldDefinitions[obj.fdIdx]); + obj.fd.visit(this); break; case FieldDefinitionsEnum.FC: - this.accept(this.parser.fieldDefinitions[obj.fdIdx]); - this.accept(this.parser.fieldDefinitionss[obj.followIdx]); + obj.fd.visit(this); + obj.follow.visit(this); break; case FieldDefinitionsEnum.FNC: - this.accept(this.parser.fieldDefinitions[obj.fdIdx]); - this.accept(this.parser.fieldDefinitionss[obj.followIdx]); + obj.fd.visit(this); + obj.follow.visit(this); break; } exit(obj); } - void enter(ref FieldDefinition obj) {} - void exit(ref FieldDefinition obj) {} + void enter(FieldDefinition obj) {} + void exit(FieldDefinition obj) {} - void accept(ref FieldDefinition obj) { + void accept(FieldDefinition obj) { enter(obj); final switch(obj.ruleSelection) { case FieldDefinitionEnum.AD: obj.name.visit(this); - this.accept(this.parser.argumentsDefinitions[obj.argIdx]); - this.accept(this.parser.types[obj.typIdx]); - this.accept(this.parser.directivess[obj.dirIdx]); + obj.arg.visit(this); + obj.typ.visit(this); + obj.dir.visit(this); break; case FieldDefinitionEnum.A: obj.name.visit(this); - this.accept(this.parser.argumentsDefinitions[obj.argIdx]); - this.accept(this.parser.types[obj.typIdx]); + obj.arg.visit(this); + obj.typ.visit(this); break; case FieldDefinitionEnum.D: obj.name.visit(this); - this.accept(this.parser.types[obj.typIdx]); - this.accept(this.parser.directivess[obj.dirIdx]); + obj.typ.visit(this); + obj.dir.visit(this); break; case FieldDefinitionEnum.T: obj.name.visit(this); - this.accept(this.parser.types[obj.typIdx]); + obj.typ.visit(this); break; case FieldDefinitionEnum.DAD: - this.accept(this.parser.descriptions[obj.desIdx]); + obj.des.visit(this); obj.name.visit(this); - this.accept(this.parser.argumentsDefinitions[obj.argIdx]); - this.accept(this.parser.types[obj.typIdx]); - this.accept(this.parser.directivess[obj.dirIdx]); + obj.arg.visit(this); + obj.typ.visit(this); + obj.dir.visit(this); break; case FieldDefinitionEnum.DA: - this.accept(this.parser.descriptions[obj.desIdx]); + obj.des.visit(this); obj.name.visit(this); - this.accept(this.parser.argumentsDefinitions[obj.argIdx]); - this.accept(this.parser.types[obj.typIdx]); + obj.arg.visit(this); + obj.typ.visit(this); break; case FieldDefinitionEnum.DD: - this.accept(this.parser.descriptions[obj.desIdx]); + obj.des.visit(this); obj.name.visit(this); - this.accept(this.parser.types[obj.typIdx]); - this.accept(this.parser.directivess[obj.dirIdx]); + obj.typ.visit(this); + obj.dir.visit(this); break; case FieldDefinitionEnum.DT: - this.accept(this.parser.descriptions[obj.desIdx]); + obj.des.visit(this); obj.name.visit(this); - this.accept(this.parser.types[obj.typIdx]); + obj.typ.visit(this); break; } exit(obj); } - void enter(ref ImplementsInterfaces obj) {} - void exit(ref ImplementsInterfaces obj) {} + void enter(ImplementsInterfaces obj) {} + void exit(ImplementsInterfaces obj) {} - void accept(ref ImplementsInterfaces obj) { + void accept(ImplementsInterfaces obj) { enter(obj); final switch(obj.ruleSelection) { case ImplementsInterfacesEnum.N: - this.accept(this.parser.namedTypess[obj.ntsIdx]); + obj.nts.visit(this); break; } exit(obj); } - void enter(ref NamedTypes obj) {} - void exit(ref NamedTypes obj) {} + void enter(NamedTypes obj) {} + void exit(NamedTypes obj) {} - void accept(ref NamedTypes obj) { + void accept(NamedTypes obj) { enter(obj); final switch(obj.ruleSelection) { case NamedTypesEnum.N: @@ -909,20 +908,20 @@ class Visitor { break; case NamedTypesEnum.NCS: obj.name.visit(this); - this.accept(this.parser.namedTypess[obj.followIdx]); + obj.follow.visit(this); break; case NamedTypesEnum.NS: obj.name.visit(this); - this.accept(this.parser.namedTypess[obj.followIdx]); + obj.follow.visit(this); break; } exit(obj); } - void enter(ref ArgumentsDefinition obj) {} - void exit(ref ArgumentsDefinition obj) {} + void enter(ArgumentsDefinition obj) {} + void exit(ArgumentsDefinition obj) {} - void accept(ref ArgumentsDefinition obj) { + void accept(ArgumentsDefinition obj) { enter(obj); final switch(obj.ruleSelection) { case ArgumentsDefinitionEnum.A: @@ -933,123 +932,123 @@ class Visitor { exit(obj); } - void enter(ref InputValueDefinitions obj) {} - void exit(ref InputValueDefinitions obj) {} + void enter(InputValueDefinitions obj) {} + void exit(InputValueDefinitions obj) {} - void accept(ref InputValueDefinitions obj) { + void accept(InputValueDefinitions obj) { enter(obj); final switch(obj.ruleSelection) { case InputValueDefinitionsEnum.I: - this.accept(this.parser.inputValueDefinitions[obj.ivIdx]); + obj.iv.visit(this); break; case InputValueDefinitionsEnum.ICF: - this.accept(this.parser.inputValueDefinitions[obj.ivIdx]); - this.accept(this.parser.inputValueDefinitionss[obj.followIdx]); + obj.iv.visit(this); + obj.follow.visit(this); break; case InputValueDefinitionsEnum.IF: - this.accept(this.parser.inputValueDefinitions[obj.ivIdx]); - this.accept(this.parser.inputValueDefinitionss[obj.followIdx]); + obj.iv.visit(this); + obj.follow.visit(this); break; } exit(obj); } - void enter(ref InputValueDefinition obj) {} - void exit(ref InputValueDefinition obj) {} + void enter(InputValueDefinition obj) {} + void exit(InputValueDefinition obj) {} - void accept(ref InputValueDefinition obj) { + void accept(InputValueDefinition obj) { enter(obj); final switch(obj.ruleSelection) { case InputValueDefinitionEnum.TVD: obj.name.visit(this); - this.accept(this.parser.types[obj.typeIdx]); - this.accept(this.parser.defaultValues[obj.dfIdx]); - this.accept(this.parser.directivess[obj.dirsIdx]); + obj.type.visit(this); + obj.df.visit(this); + obj.dirs.visit(this); break; case InputValueDefinitionEnum.TD: obj.name.visit(this); - this.accept(this.parser.types[obj.typeIdx]); - this.accept(this.parser.directivess[obj.dirsIdx]); + obj.type.visit(this); + obj.dirs.visit(this); break; case InputValueDefinitionEnum.TV: obj.name.visit(this); - this.accept(this.parser.types[obj.typeIdx]); - this.accept(this.parser.defaultValues[obj.dfIdx]); + obj.type.visit(this); + obj.df.visit(this); break; case InputValueDefinitionEnum.T: obj.name.visit(this); - this.accept(this.parser.types[obj.typeIdx]); + obj.type.visit(this); break; case InputValueDefinitionEnum.DTVD: - this.accept(this.parser.descriptions[obj.desIdx]); + obj.des.visit(this); obj.name.visit(this); - this.accept(this.parser.types[obj.typeIdx]); - this.accept(this.parser.defaultValues[obj.dfIdx]); - this.accept(this.parser.directivess[obj.dirsIdx]); + obj.type.visit(this); + obj.df.visit(this); + obj.dirs.visit(this); break; case InputValueDefinitionEnum.DTD: - this.accept(this.parser.descriptions[obj.desIdx]); + obj.des.visit(this); obj.name.visit(this); - this.accept(this.parser.types[obj.typeIdx]); - this.accept(this.parser.directivess[obj.dirsIdx]); + obj.type.visit(this); + obj.dirs.visit(this); break; case InputValueDefinitionEnum.DTV: - this.accept(this.parser.descriptions[obj.desIdx]); + obj.des.visit(this); obj.name.visit(this); - this.accept(this.parser.types[obj.typeIdx]); - this.accept(this.parser.defaultValues[obj.dfIdx]); + obj.type.visit(this); + obj.df.visit(this); break; case InputValueDefinitionEnum.DT: - this.accept(this.parser.descriptions[obj.desIdx]); + obj.des.visit(this); obj.name.visit(this); - this.accept(this.parser.types[obj.typeIdx]); + obj.type.visit(this); break; } exit(obj); } - void enter(ref InterfaceTypeDefinition obj) {} - void exit(ref InterfaceTypeDefinition obj) {} + void enter(InterfaceTypeDefinition obj) {} + void exit(InterfaceTypeDefinition obj) {} - void accept(ref InterfaceTypeDefinition obj) { + void accept(InterfaceTypeDefinition obj) { enter(obj); final switch(obj.ruleSelection) { case InterfaceTypeDefinitionEnum.NDF: obj.name.visit(this); - this.accept(this.parser.directivess[obj.dirsIdx]); - this.accept(this.parser.fieldDefinitionss[obj.fdsIdx]); + obj.dirs.visit(this); + obj.fds.visit(this); break; case InterfaceTypeDefinitionEnum.NF: obj.name.visit(this); - this.accept(this.parser.fieldDefinitionss[obj.fdsIdx]); + obj.fds.visit(this); break; } exit(obj); } - void enter(ref UnionTypeDefinition obj) {} - void exit(ref UnionTypeDefinition obj) {} + void enter(UnionTypeDefinition obj) {} + void exit(UnionTypeDefinition obj) {} - void accept(ref UnionTypeDefinition obj) { + void accept(UnionTypeDefinition obj) { enter(obj); final switch(obj.ruleSelection) { case UnionTypeDefinitionEnum.NDU: obj.name.visit(this); - this.accept(this.parser.directivess[obj.dirsIdx]); - this.accept(this.parser.unionMemberss[obj.umIdx]); + obj.dirs.visit(this); + obj.um.visit(this); break; case UnionTypeDefinitionEnum.NU: obj.name.visit(this); - this.accept(this.parser.unionMemberss[obj.umIdx]); + obj.um.visit(this); break; } exit(obj); } - void enter(ref UnionMembers obj) {} - void exit(ref UnionMembers obj) {} + void enter(UnionMembers obj) {} + void exit(UnionMembers obj) {} - void accept(ref UnionMembers obj) { + void accept(UnionMembers obj) { enter(obj); final switch(obj.ruleSelection) { case UnionMembersEnum.S: @@ -1057,137 +1056,137 @@ class Visitor { break; case UnionMembersEnum.SPF: obj.name.visit(this); - this.accept(this.parser.unionMemberss[obj.followIdx]); + obj.follow.visit(this); break; case UnionMembersEnum.SF: obj.name.visit(this); - this.accept(this.parser.unionMemberss[obj.followIdx]); + obj.follow.visit(this); break; } exit(obj); } - void enter(ref EnumTypeDefinition obj) {} - void exit(ref EnumTypeDefinition obj) {} + void enter(EnumTypeDefinition obj) {} + void exit(EnumTypeDefinition obj) {} - void accept(ref EnumTypeDefinition obj) { + void accept(EnumTypeDefinition obj) { enter(obj); final switch(obj.ruleSelection) { case EnumTypeDefinitionEnum.NDE: obj.name.visit(this); - this.accept(this.parser.directivess[obj.dirIdx]); - this.accept(this.parser.enumValueDefinitionss[obj.evdsIdx]); + obj.dir.visit(this); + obj.evds.visit(this); break; case EnumTypeDefinitionEnum.NE: obj.name.visit(this); - this.accept(this.parser.enumValueDefinitionss[obj.evdsIdx]); + obj.evds.visit(this); break; } exit(obj); } - void enter(ref EnumValueDefinitions obj) {} - void exit(ref EnumValueDefinitions obj) {} + void enter(EnumValueDefinitions obj) {} + void exit(EnumValueDefinitions obj) {} - void accept(ref EnumValueDefinitions obj) { + void accept(EnumValueDefinitions obj) { enter(obj); final switch(obj.ruleSelection) { case EnumValueDefinitionsEnum.D: - this.accept(this.parser.enumValueDefinitions[obj.evdIdx]); + obj.evd.visit(this); break; case EnumValueDefinitionsEnum.DCE: - this.accept(this.parser.enumValueDefinitions[obj.evdIdx]); - this.accept(this.parser.enumValueDefinitionss[obj.followIdx]); + obj.evd.visit(this); + obj.follow.visit(this); break; case EnumValueDefinitionsEnum.DE: - this.accept(this.parser.enumValueDefinitions[obj.evdIdx]); - this.accept(this.parser.enumValueDefinitionss[obj.followIdx]); + obj.evd.visit(this); + obj.follow.visit(this); break; } exit(obj); } - void enter(ref EnumValueDefinition obj) {} - void exit(ref EnumValueDefinition obj) {} + void enter(EnumValueDefinition obj) {} + void exit(EnumValueDefinition obj) {} - void accept(ref EnumValueDefinition obj) { + void accept(EnumValueDefinition obj) { enter(obj); final switch(obj.ruleSelection) { case EnumValueDefinitionEnum.ED: obj.name.visit(this); - this.accept(this.parser.directivess[obj.dirsIdx]); + obj.dirs.visit(this); break; case EnumValueDefinitionEnum.E: obj.name.visit(this); break; case EnumValueDefinitionEnum.DED: - this.accept(this.parser.descriptions[obj.desIdx]); + obj.des.visit(this); obj.name.visit(this); - this.accept(this.parser.directivess[obj.dirsIdx]); + obj.dirs.visit(this); break; case EnumValueDefinitionEnum.DE: - this.accept(this.parser.descriptions[obj.desIdx]); + obj.des.visit(this); obj.name.visit(this); break; } exit(obj); } - void enter(ref InputTypeDefinition obj) {} - void exit(ref InputTypeDefinition obj) {} + void enter(InputTypeDefinition obj) {} + void exit(InputTypeDefinition obj) {} - void accept(ref InputTypeDefinition obj) { + void accept(InputTypeDefinition obj) { enter(obj); final switch(obj.ruleSelection) { case InputTypeDefinitionEnum.NDE: obj.name.visit(this); - this.accept(this.parser.directivess[obj.dirIdx]); - this.accept(this.parser.inputValueDefinitionss[obj.ivdsIdx]); + obj.dir.visit(this); + obj.ivds.visit(this); break; case InputTypeDefinitionEnum.NE: obj.name.visit(this); - this.accept(this.parser.inputValueDefinitionss[obj.ivdsIdx]); + obj.ivds.visit(this); break; } exit(obj); } - void enter(ref TypeExtensionDefinition obj) {} - void exit(ref TypeExtensionDefinition obj) {} + void enter(TypeExtensionDefinition obj) {} + void exit(TypeExtensionDefinition obj) {} - void accept(ref TypeExtensionDefinition obj) { + void accept(TypeExtensionDefinition obj) { enter(obj); final switch(obj.ruleSelection) { case TypeExtensionDefinitionEnum.O: - this.accept(this.parser.objectTypeDefinitions[obj.otdIdx]); + obj.otd.visit(this); break; } exit(obj); } - void enter(ref DirectiveDefinition obj) {} - void exit(ref DirectiveDefinition obj) {} + void enter(DirectiveDefinition obj) {} + void exit(DirectiveDefinition obj) {} - void accept(ref DirectiveDefinition obj) { + void accept(DirectiveDefinition obj) { enter(obj); final switch(obj.ruleSelection) { case DirectiveDefinitionEnum.AD: obj.name.visit(this); - this.accept(this.parser.argumentsDefinitions[obj.adIdx]); - this.accept(this.parser.directiveLocationss[obj.dlIdx]); + obj.ad.visit(this); + obj.dl.visit(this); break; case DirectiveDefinitionEnum.D: obj.name.visit(this); - this.accept(this.parser.directiveLocationss[obj.dlIdx]); + obj.dl.visit(this); break; } exit(obj); } - void enter(ref DirectiveLocations obj) {} - void exit(ref DirectiveLocations obj) {} + void enter(DirectiveLocations obj) {} + void exit(DirectiveLocations obj) {} - void accept(ref DirectiveLocations obj) { + void accept(DirectiveLocations obj) { enter(obj); final switch(obj.ruleSelection) { case DirectiveLocationsEnum.N: @@ -1195,25 +1194,25 @@ class Visitor { break; case DirectiveLocationsEnum.NPF: obj.name.visit(this); - this.accept(this.parser.directiveLocationss[obj.followIdx]); + obj.follow.visit(this); break; case DirectiveLocationsEnum.NF: obj.name.visit(this); - this.accept(this.parser.directiveLocationss[obj.followIdx]); + obj.follow.visit(this); break; } exit(obj); } - void enter(ref InputObjectTypeDefinition obj) {} - void exit(ref InputObjectTypeDefinition obj) {} + void enter(InputObjectTypeDefinition obj) {} + void exit(InputObjectTypeDefinition obj) {} - void accept(ref InputObjectTypeDefinition obj) { + void accept(InputObjectTypeDefinition obj) { enter(obj); final switch(obj.ruleSelection) { case InputObjectTypeDefinitionEnum.NDI: obj.name.visit(this); - this.accept(this.parser.directivess[obj.dirsIdx]); + obj.dirs.visit(this); break; case InputObjectTypeDefinitionEnum.NI: obj.name.visit(this); @@ -1222,10 +1221,10 @@ class Visitor { exit(obj); } - void enter(ref Description obj) {} - void exit(ref Description obj) {} + void enter(Description obj) {} + void exit(Description obj) {} - void accept(ref Description obj) { + void accept(Description obj) { enter(obj); final switch(obj.ruleSelection) { case DescriptionEnum.S: @@ -1239,136 +1238,130 @@ class Visitor { class ConstVisitor { @safe : - Parser* parser; - this(Parser* parser) { - this.parser = parser; - } + void enter(const(Document) obj) {} + void exit(const(Document) obj) {} - - void enter(ref const(Document) obj) {} - void exit(ref const(Document) obj) {} - - void accept(ref const(Document) obj) { + void accept(const(Document) obj) { enter(obj); final switch(obj.ruleSelection) { case DocumentEnum.Defi: - this.accept(this.parser.definitionss[obj.defsIdx]); + obj.defs.visit(this); break; } exit(obj); } - void enter(ref const(Definitions) obj) {} - void exit(ref const(Definitions) obj) {} + void enter(const(Definitions) obj) {} + void exit(const(Definitions) obj) {} - void accept(ref const(Definitions) obj) { + void accept(const(Definitions) obj) { enter(obj); final switch(obj.ruleSelection) { case DefinitionsEnum.Def: - this.accept(this.parser.definitions[obj.defIdx]); + obj.def.visit(this); break; case DefinitionsEnum.Defs: - this.accept(this.parser.definitions[obj.defIdx]); - this.accept(this.parser.definitionss[obj.followIdx]); + obj.def.visit(this); + obj.follow.visit(this); break; } exit(obj); } - void enter(ref const(Definition) obj) {} - void exit(ref const(Definition) obj) {} + void enter(const(Definition) obj) {} + void exit(const(Definition) obj) {} - void accept(ref const(Definition) obj) { + void accept(const(Definition) obj) { enter(obj); final switch(obj.ruleSelection) { case DefinitionEnum.O: - this.accept(this.parser.operationDefinitions[obj.opIdx]); + obj.op.visit(this); break; case DefinitionEnum.F: - this.accept(this.parser.fragmentDefinitions[obj.fragIdx]); + obj.frag.visit(this); break; case DefinitionEnum.T: - this.accept(this.parser.typeSystemDefinitions[obj.typeIdx]); + obj.type.visit(this); break; } exit(obj); } - void enter(ref const(OperationDefinition) obj) {} - void exit(ref const(OperationDefinition) obj) {} + void enter(const(OperationDefinition) obj) {} + void exit(const(OperationDefinition) obj) {} - void accept(ref const(OperationDefinition) obj) { + void accept(const(OperationDefinition) obj) { enter(obj); final switch(obj.ruleSelection) { case OperationDefinitionEnum.SelSet: - this.accept(this.parser.selectionSets[obj.ssIdx]); + obj.ss.visit(this); break; case OperationDefinitionEnum.OT_N_VD: - this.accept(this.parser.operationTypes[obj.otIdx]); + obj.ot.visit(this); obj.name.visit(this); - this.accept(this.parser.variableDefinitionss[obj.vdIdx]); - this.accept(this.parser.directivess[obj.dIdx]); - this.accept(this.parser.selectionSets[obj.ssIdx]); + obj.vd.visit(this); + obj.d.visit(this); + obj.ss.visit(this); break; case OperationDefinitionEnum.OT_N_V: - this.accept(this.parser.operationTypes[obj.otIdx]); + obj.ot.visit(this); obj.name.visit(this); - this.accept(this.parser.variableDefinitionss[obj.vdIdx]); - this.accept(this.parser.selectionSets[obj.ssIdx]); + obj.vd.visit(this); + obj.ss.visit(this); break; case OperationDefinitionEnum.OT_N_D: - this.accept(this.parser.operationTypes[obj.otIdx]); + obj.ot.visit(this); obj.name.visit(this); - this.accept(this.parser.directivess[obj.dIdx]); - this.accept(this.parser.selectionSets[obj.ssIdx]); + obj.d.visit(this); + obj.ss.visit(this); break; case OperationDefinitionEnum.OT_N: - this.accept(this.parser.operationTypes[obj.otIdx]); + obj.ot.visit(this); obj.name.visit(this); - this.accept(this.parser.selectionSets[obj.ssIdx]); + obj.ss.visit(this); break; case OperationDefinitionEnum.OT_VD: - this.accept(this.parser.operationTypes[obj.otIdx]); - this.accept(this.parser.variableDefinitionss[obj.vdIdx]); - this.accept(this.parser.directivess[obj.dIdx]); - this.accept(this.parser.selectionSets[obj.ssIdx]); + obj.ot.visit(this); + obj.vd.visit(this); + obj.d.visit(this); + obj.ss.visit(this); break; case OperationDefinitionEnum.OT_V: - this.accept(this.parser.operationTypes[obj.otIdx]); - this.accept(this.parser.variableDefinitionss[obj.vdIdx]); - this.accept(this.parser.selectionSets[obj.ssIdx]); + obj.ot.visit(this); + obj.vd.visit(this); + obj.ss.visit(this); break; case OperationDefinitionEnum.OT_D: - this.accept(this.parser.operationTypes[obj.otIdx]); - this.accept(this.parser.directivess[obj.dIdx]); - this.accept(this.parser.selectionSets[obj.ssIdx]); + obj.ot.visit(this); + obj.d.visit(this); + obj.ss.visit(this); break; case OperationDefinitionEnum.OT: - this.accept(this.parser.operationTypes[obj.otIdx]); - this.accept(this.parser.selectionSets[obj.ssIdx]); + obj.ot.visit(this); + obj.ss.visit(this); break; } exit(obj); } - void enter(ref const(SelectionSet) obj) {} - void exit(ref const(SelectionSet) obj) {} + void enter(const(SelectionSet) obj) {} + void exit(const(SelectionSet) obj) {} - void accept(ref const(SelectionSet) obj) { + void accept(const(SelectionSet) obj) { enter(obj); final switch(obj.ruleSelection) { case SelectionSetEnum.SS: - this.accept(this.parser.selectionss[obj.selIdx]); + obj.sel.visit(this); break; } exit(obj); } - void enter(ref const(OperationType) obj) {} - void exit(ref const(OperationType) obj) {} + void enter(const(OperationType) obj) {} + void exit(const(OperationType) obj) {} - void accept(ref const(OperationType) obj) { + void accept(const(OperationType) obj) { enter(obj); final switch(obj.ruleSelection) { case OperationTypeEnum.Query: @@ -1384,55 +1377,55 @@ class ConstVisitor { exit(obj); } - void enter(ref const(Selections) obj) {} - void exit(ref const(Selections) obj) {} + void enter(const(Selections) obj) {} + void exit(const(Selections) obj) {} - void accept(ref const(Selections) obj) { + void accept(const(Selections) obj) { enter(obj); final switch(obj.ruleSelection) { case SelectionsEnum.Sel: - this.accept(this.parser.selections[obj.selIdx]); + obj.sel.visit(this); break; case SelectionsEnum.Sels: - this.accept(this.parser.selections[obj.selIdx]); - this.accept(this.parser.selectionss[obj.followIdx]); + obj.sel.visit(this); + obj.follow.visit(this); break; case SelectionsEnum.Selsc: - this.accept(this.parser.selections[obj.selIdx]); - this.accept(this.parser.selectionss[obj.followIdx]); + obj.sel.visit(this); + obj.follow.visit(this); break; } exit(obj); } - void enter(ref const(Selection) obj) {} - void exit(ref const(Selection) obj) {} + void enter(const(Selection) obj) {} + void exit(const(Selection) obj) {} - void accept(ref const(Selection) obj) { + void accept(const(Selection) obj) { enter(obj); final switch(obj.ruleSelection) { case SelectionEnum.Field: - this.accept(this.parser.fields[obj.fieldIdx]); + obj.field.visit(this); break; case SelectionEnum.Spread: - this.accept(this.parser.fragmentSpreads[obj.fragIdx]); + obj.frag.visit(this); break; case SelectionEnum.IFrag: - this.accept(this.parser.inlineFragments[obj.ifragIdx]); + obj.ifrag.visit(this); break; } exit(obj); } - void enter(ref const(FragmentSpread) obj) {} - void exit(ref const(FragmentSpread) obj) {} + void enter(const(FragmentSpread) obj) {} + void exit(const(FragmentSpread) obj) {} - void accept(ref const(FragmentSpread) obj) { + void accept(const(FragmentSpread) obj) { enter(obj); final switch(obj.ruleSelection) { case FragmentSpreadEnum.FD: obj.name.visit(this); - this.accept(this.parser.directivess[obj.dirsIdx]); + obj.dirs.visit(this); break; case FragmentSpreadEnum.F: obj.name.visit(this); @@ -1441,82 +1434,82 @@ class ConstVisitor { exit(obj); } - void enter(ref const(InlineFragment) obj) {} - void exit(ref const(InlineFragment) obj) {} + void enter(const(InlineFragment) obj) {} + void exit(const(InlineFragment) obj) {} - void accept(ref const(InlineFragment) obj) { + void accept(const(InlineFragment) obj) { enter(obj); final switch(obj.ruleSelection) { case InlineFragmentEnum.TDS: obj.tc.visit(this); - this.accept(this.parser.directivess[obj.dirsIdx]); - this.accept(this.parser.selectionSets[obj.ssIdx]); + obj.dirs.visit(this); + obj.ss.visit(this); break; case InlineFragmentEnum.TS: obj.tc.visit(this); - this.accept(this.parser.selectionSets[obj.ssIdx]); + obj.ss.visit(this); break; case InlineFragmentEnum.DS: - this.accept(this.parser.directivess[obj.dirsIdx]); - this.accept(this.parser.selectionSets[obj.ssIdx]); + obj.dirs.visit(this); + obj.ss.visit(this); break; case InlineFragmentEnum.S: - this.accept(this.parser.selectionSets[obj.ssIdx]); + obj.ss.visit(this); break; } exit(obj); } - void enter(ref const(Field) obj) {} - void exit(ref const(Field) obj) {} + void enter(const(Field) obj) {} + void exit(const(Field) obj) {} - void accept(ref const(Field) obj) { + void accept(const(Field) obj) { enter(obj); final switch(obj.ruleSelection) { case FieldEnum.FADS: - this.accept(this.parser.fieldNames[obj.nameIdx]); - this.accept(this.parser.argumentss[obj.argsIdx]); - this.accept(this.parser.directivess[obj.dirsIdx]); - this.accept(this.parser.selectionSets[obj.ssIdx]); + obj.name.visit(this); + obj.args.visit(this); + obj.dirs.visit(this); + obj.ss.visit(this); break; case FieldEnum.FAS: - this.accept(this.parser.fieldNames[obj.nameIdx]); - this.accept(this.parser.argumentss[obj.argsIdx]); - this.accept(this.parser.selectionSets[obj.ssIdx]); + obj.name.visit(this); + obj.args.visit(this); + obj.ss.visit(this); break; case FieldEnum.FAD: - this.accept(this.parser.fieldNames[obj.nameIdx]); - this.accept(this.parser.argumentss[obj.argsIdx]); - this.accept(this.parser.directivess[obj.dirsIdx]); + obj.name.visit(this); + obj.args.visit(this); + obj.dirs.visit(this); break; case FieldEnum.FDS: - this.accept(this.parser.fieldNames[obj.nameIdx]); - this.accept(this.parser.directivess[obj.dirsIdx]); - this.accept(this.parser.selectionSets[obj.ssIdx]); + obj.name.visit(this); + obj.dirs.visit(this); + obj.ss.visit(this); break; case FieldEnum.FS: - this.accept(this.parser.fieldNames[obj.nameIdx]); - this.accept(this.parser.selectionSets[obj.ssIdx]); + obj.name.visit(this); + obj.ss.visit(this); break; case FieldEnum.FD: - this.accept(this.parser.fieldNames[obj.nameIdx]); - this.accept(this.parser.directivess[obj.dirsIdx]); + obj.name.visit(this); + obj.dirs.visit(this); break; case FieldEnum.FA: - this.accept(this.parser.fieldNames[obj.nameIdx]); - this.accept(this.parser.argumentss[obj.argsIdx]); + obj.name.visit(this); + obj.args.visit(this); break; case FieldEnum.F: - this.accept(this.parser.fieldNames[obj.nameIdx]); + obj.name.visit(this); break; } exit(obj); } - void enter(ref const(FieldName) obj) {} - void exit(ref const(FieldName) obj) {} + void enter(const(FieldName) obj) {} + void exit(const(FieldName) obj) {} - void accept(ref const(FieldName) obj) { + void accept(const(FieldName) obj) { enter(obj); final switch(obj.ruleSelection) { case FieldNameEnum.A: @@ -1530,14 +1523,14 @@ class ConstVisitor { exit(obj); } - void enter(ref const(Arguments) obj) {} - void exit(ref const(Arguments) obj) {} + void enter(const(Arguments) obj) {} + void exit(const(Arguments) obj) {} - void accept(ref const(Arguments) obj) { + void accept(const(Arguments) obj) { enter(obj); final switch(obj.ruleSelection) { case ArgumentsEnum.List: - this.accept(this.parser.argumentLists[obj.argIdx]); + obj.arg.visit(this); break; case ArgumentsEnum.Empty: break; @@ -1545,88 +1538,88 @@ class ConstVisitor { exit(obj); } - void enter(ref const(ArgumentList) obj) {} - void exit(ref const(ArgumentList) obj) {} + void enter(const(ArgumentList) obj) {} + void exit(const(ArgumentList) obj) {} - void accept(ref const(ArgumentList) obj) { + void accept(const(ArgumentList) obj) { enter(obj); final switch(obj.ruleSelection) { case ArgumentListEnum.A: - this.accept(this.parser.arguments[obj.argIdx]); + obj.arg.visit(this); break; case ArgumentListEnum.ACS: - this.accept(this.parser.arguments[obj.argIdx]); - this.accept(this.parser.argumentLists[obj.followIdx]); + obj.arg.visit(this); + obj.follow.visit(this); break; case ArgumentListEnum.AS: - this.accept(this.parser.arguments[obj.argIdx]); - this.accept(this.parser.argumentLists[obj.followIdx]); + obj.arg.visit(this); + obj.follow.visit(this); break; } exit(obj); } - void enter(ref const(Argument) obj) {} - void exit(ref const(Argument) obj) {} + void enter(const(Argument) obj) {} + void exit(const(Argument) obj) {} - void accept(ref const(Argument) obj) { + void accept(const(Argument) obj) { enter(obj); final switch(obj.ruleSelection) { case ArgumentEnum.Name: obj.name.visit(this); - this.accept(this.parser.valueOrVariables[obj.vvIdx]); + obj.vv.visit(this); break; } exit(obj); } - void enter(ref const(FragmentDefinition) obj) {} - void exit(ref const(FragmentDefinition) obj) {} + void enter(const(FragmentDefinition) obj) {} + void exit(const(FragmentDefinition) obj) {} - void accept(ref const(FragmentDefinition) obj) { + void accept(const(FragmentDefinition) obj) { enter(obj); final switch(obj.ruleSelection) { case FragmentDefinitionEnum.FTDS: obj.name.visit(this); obj.tc.visit(this); - this.accept(this.parser.directivess[obj.dirsIdx]); - this.accept(this.parser.selectionSets[obj.ssIdx]); + obj.dirs.visit(this); + obj.ss.visit(this); break; case FragmentDefinitionEnum.FTS: obj.name.visit(this); obj.tc.visit(this); - this.accept(this.parser.selectionSets[obj.ssIdx]); + obj.ss.visit(this); break; } exit(obj); } - void enter(ref const(Directives) obj) {} - void exit(ref const(Directives) obj) {} + void enter(const(Directives) obj) {} + void exit(const(Directives) obj) {} - void accept(ref const(Directives) obj) { + void accept(const(Directives) obj) { enter(obj); final switch(obj.ruleSelection) { case DirectivesEnum.Dir: - this.accept(this.parser.directives[obj.dirIdx]); + obj.dir.visit(this); break; case DirectivesEnum.Dirs: - this.accept(this.parser.directives[obj.dirIdx]); - this.accept(this.parser.directivess[obj.followIdx]); + obj.dir.visit(this); + obj.follow.visit(this); break; } exit(obj); } - void enter(ref const(Directive) obj) {} - void exit(ref const(Directive) obj) {} + void enter(const(Directive) obj) {} + void exit(const(Directive) obj) {} - void accept(ref const(Directive) obj) { + void accept(const(Directive) obj) { enter(obj); final switch(obj.ruleSelection) { case DirectiveEnum.NArg: obj.name.visit(this); - this.accept(this.parser.argumentss[obj.argIdx]); + obj.arg.visit(this); break; case DirectiveEnum.N: obj.name.visit(this); @@ -1635,65 +1628,65 @@ class ConstVisitor { exit(obj); } - void enter(ref const(VariableDefinitions) obj) {} - void exit(ref const(VariableDefinitions) obj) {} + void enter(const(VariableDefinitions) obj) {} + void exit(const(VariableDefinitions) obj) {} - void accept(ref const(VariableDefinitions) obj) { + void accept(const(VariableDefinitions) obj) { enter(obj); final switch(obj.ruleSelection) { case VariableDefinitionsEnum.Empty: break; case VariableDefinitionsEnum.Vars: - this.accept(this.parser.variableDefinitionLists[obj.varsIdx]); + obj.vars.visit(this); break; } exit(obj); } - void enter(ref const(VariableDefinitionList) obj) {} - void exit(ref const(VariableDefinitionList) obj) {} + void enter(const(VariableDefinitionList) obj) {} + void exit(const(VariableDefinitionList) obj) {} - void accept(ref const(VariableDefinitionList) obj) { + void accept(const(VariableDefinitionList) obj) { enter(obj); final switch(obj.ruleSelection) { case VariableDefinitionListEnum.V: - this.accept(this.parser.variableDefinitions[obj.varIdx]); + obj.var.visit(this); break; case VariableDefinitionListEnum.VCF: - this.accept(this.parser.variableDefinitions[obj.varIdx]); - this.accept(this.parser.variableDefinitionLists[obj.followIdx]); + obj.var.visit(this); + obj.follow.visit(this); break; case VariableDefinitionListEnum.VF: - this.accept(this.parser.variableDefinitions[obj.varIdx]); - this.accept(this.parser.variableDefinitionLists[obj.followIdx]); + obj.var.visit(this); + obj.follow.visit(this); break; } exit(obj); } - void enter(ref const(VariableDefinition) obj) {} - void exit(ref const(VariableDefinition) obj) {} + void enter(const(VariableDefinition) obj) {} + void exit(const(VariableDefinition) obj) {} - void accept(ref const(VariableDefinition) obj) { + void accept(const(VariableDefinition) obj) { enter(obj); final switch(obj.ruleSelection) { case VariableDefinitionEnum.VarD: - this.accept(this.parser.variables[obj.varIdx]); - this.accept(this.parser.types[obj.typeIdx]); - this.accept(this.parser.defaultValues[obj.dvalueIdx]); + obj.var.visit(this); + obj.type.visit(this); + obj.dvalue.visit(this); break; case VariableDefinitionEnum.Var: - this.accept(this.parser.variables[obj.varIdx]); - this.accept(this.parser.types[obj.typeIdx]); + obj.var.visit(this); + obj.type.visit(this); break; } exit(obj); } - void enter(ref const(Variable) obj) {} - void exit(ref const(Variable) obj) {} + void enter(const(Variable) obj) {} + void exit(const(Variable) obj) {} - void accept(ref const(Variable) obj) { + void accept(const(Variable) obj) { enter(obj); final switch(obj.ruleSelection) { case VariableEnum.Var: @@ -1703,39 +1696,39 @@ class ConstVisitor { exit(obj); } - void enter(ref const(DefaultValue) obj) {} - void exit(ref const(DefaultValue) obj) {} + void enter(const(DefaultValue) obj) {} + void exit(const(DefaultValue) obj) {} - void accept(ref const(DefaultValue) obj) { + void accept(const(DefaultValue) obj) { enter(obj); final switch(obj.ruleSelection) { case DefaultValueEnum.DV: - this.accept(this.parser.values[obj.valueIdx]); + obj.value.visit(this); break; } exit(obj); } - void enter(ref const(ValueOrVariable) obj) {} - void exit(ref const(ValueOrVariable) obj) {} + void enter(const(ValueOrVariable) obj) {} + void exit(const(ValueOrVariable) obj) {} - void accept(ref const(ValueOrVariable) obj) { + void accept(const(ValueOrVariable) obj) { enter(obj); final switch(obj.ruleSelection) { case ValueOrVariableEnum.Val: - this.accept(this.parser.values[obj.valIdx]); + obj.val.visit(this); break; case ValueOrVariableEnum.Var: - this.accept(this.parser.variables[obj.varIdx]); + obj.var.visit(this); break; } exit(obj); } - void enter(ref const(Value) obj) {} - void exit(ref const(Value) obj) {} + void enter(const(Value) obj) {} + void exit(const(Value) obj) {} - void accept(ref const(Value) obj) { + void accept(const(Value) obj) { enter(obj); final switch(obj.ruleSelection) { case ValueEnum.STR: @@ -1754,10 +1747,10 @@ class ConstVisitor { obj.tok.visit(this); break; case ValueEnum.ARR: - this.accept(this.parser.arrays[obj.arrIdx]); + obj.arr.visit(this); break; case ValueEnum.O: - this.accept(this.parser.objectTypes[obj.objIdx]); + obj.obj.visit(this); break; case ValueEnum.E: obj.tok.visit(this); @@ -1769,241 +1762,241 @@ class ConstVisitor { exit(obj); } - void enter(ref const(Type) obj) {} - void exit(ref const(Type) obj) {} + void enter(const(Type) obj) {} + void exit(const(Type) obj) {} - void accept(ref const(Type) obj) { + void accept(const(Type) obj) { enter(obj); final switch(obj.ruleSelection) { case TypeEnum.TN: obj.tname.visit(this); break; case TypeEnum.LN: - this.accept(this.parser.listTypes[obj.listIdx]); + obj.list.visit(this); break; case TypeEnum.T: obj.tname.visit(this); break; case TypeEnum.L: - this.accept(this.parser.listTypes[obj.listIdx]); + obj.list.visit(this); break; } exit(obj); } - void enter(ref const(ListType) obj) {} - void exit(ref const(ListType) obj) {} + void enter(const(ListType) obj) {} + void exit(const(ListType) obj) {} - void accept(ref const(ListType) obj) { + void accept(const(ListType) obj) { enter(obj); final switch(obj.ruleSelection) { case ListTypeEnum.T: - this.accept(this.parser.types[obj.typeIdx]); + obj.type.visit(this); break; } exit(obj); } - void enter(ref const(Values) obj) {} - void exit(ref const(Values) obj) {} + void enter(const(Values) obj) {} + void exit(const(Values) obj) {} - void accept(ref const(Values) obj) { + void accept(const(Values) obj) { enter(obj); final switch(obj.ruleSelection) { case ValuesEnum.Val: - this.accept(this.parser.values[obj.valIdx]); + obj.val.visit(this); break; case ValuesEnum.Vals: - this.accept(this.parser.values[obj.valIdx]); - this.accept(this.parser.valuess[obj.followIdx]); + obj.val.visit(this); + obj.follow.visit(this); break; case ValuesEnum.ValsNoComma: - this.accept(this.parser.values[obj.valIdx]); - this.accept(this.parser.valuess[obj.followIdx]); + obj.val.visit(this); + obj.follow.visit(this); break; } exit(obj); } - void enter(ref const(Array) obj) {} - void exit(ref const(Array) obj) {} + void enter(const(Array) obj) {} + void exit(const(Array) obj) {} - void accept(ref const(Array) obj) { + void accept(const(Array) obj) { enter(obj); final switch(obj.ruleSelection) { case ArrayEnum.Empty: break; case ArrayEnum.Value: - this.accept(this.parser.valuess[obj.valsIdx]); + obj.vals.visit(this); break; } exit(obj); } - void enter(ref const(ObjectValues) obj) {} - void exit(ref const(ObjectValues) obj) {} + void enter(const(ObjectValues) obj) {} + void exit(const(ObjectValues) obj) {} - void accept(ref const(ObjectValues) obj) { + void accept(const(ObjectValues) obj) { enter(obj); final switch(obj.ruleSelection) { case ObjectValuesEnum.V: obj.name.visit(this); - this.accept(this.parser.valueOrVariables[obj.valIdx]); + obj.val.visit(this); break; case ObjectValuesEnum.Vsc: obj.name.visit(this); - this.accept(this.parser.valueOrVariables[obj.valIdx]); - this.accept(this.parser.objectValuess[obj.followIdx]); + obj.val.visit(this); + obj.follow.visit(this); break; case ObjectValuesEnum.Vs: obj.name.visit(this); - this.accept(this.parser.valueOrVariables[obj.valIdx]); - this.accept(this.parser.objectValuess[obj.followIdx]); + obj.val.visit(this); + obj.follow.visit(this); break; } exit(obj); } - void enter(ref const(ObjectType) obj) {} - void exit(ref const(ObjectType) obj) {} + void enter(const(ObjectType) obj) {} + void exit(const(ObjectType) obj) {} - void accept(ref const(ObjectType) obj) { + void accept(const(ObjectType) obj) { enter(obj); final switch(obj.ruleSelection) { case ObjectTypeEnum.Var: - this.accept(this.parser.objectValuess[obj.valsIdx]); + obj.vals.visit(this); break; } exit(obj); } - void enter(ref const(TypeSystemDefinition) obj) {} - void exit(ref const(TypeSystemDefinition) obj) {} + void enter(const(TypeSystemDefinition) obj) {} + void exit(const(TypeSystemDefinition) obj) {} - void accept(ref const(TypeSystemDefinition) obj) { + void accept(const(TypeSystemDefinition) obj) { enter(obj); final switch(obj.ruleSelection) { case TypeSystemDefinitionEnum.S: - this.accept(this.parser.schemaDefinitions[obj.schIdx]); + obj.sch.visit(this); break; case TypeSystemDefinitionEnum.T: - this.accept(this.parser.typeDefinitions[obj.tdIdx]); + obj.td.visit(this); break; case TypeSystemDefinitionEnum.TE: - this.accept(this.parser.typeExtensionDefinitions[obj.tedIdx]); + obj.ted.visit(this); break; case TypeSystemDefinitionEnum.D: - this.accept(this.parser.directiveDefinitions[obj.ddIdx]); + obj.dd.visit(this); break; case TypeSystemDefinitionEnum.DS: - this.accept(this.parser.descriptions[obj.desIdx]); - this.accept(this.parser.schemaDefinitions[obj.schIdx]); + obj.des.visit(this); + obj.sch.visit(this); break; case TypeSystemDefinitionEnum.DT: - this.accept(this.parser.descriptions[obj.desIdx]); - this.accept(this.parser.typeDefinitions[obj.tdIdx]); + obj.des.visit(this); + obj.td.visit(this); break; case TypeSystemDefinitionEnum.DTE: - this.accept(this.parser.descriptions[obj.desIdx]); - this.accept(this.parser.typeExtensionDefinitions[obj.tedIdx]); + obj.des.visit(this); + obj.ted.visit(this); break; case TypeSystemDefinitionEnum.DD: - this.accept(this.parser.descriptions[obj.desIdx]); - this.accept(this.parser.directiveDefinitions[obj.ddIdx]); + obj.des.visit(this); + obj.dd.visit(this); break; } exit(obj); } - void enter(ref const(TypeDefinition) obj) {} - void exit(ref const(TypeDefinition) obj) {} + void enter(const(TypeDefinition) obj) {} + void exit(const(TypeDefinition) obj) {} - void accept(ref const(TypeDefinition) obj) { + void accept(const(TypeDefinition) obj) { enter(obj); final switch(obj.ruleSelection) { case TypeDefinitionEnum.S: - this.accept(this.parser.scalarTypeDefinitions[obj.stdIdx]); + obj.std.visit(this); break; case TypeDefinitionEnum.O: - this.accept(this.parser.objectTypeDefinitions[obj.otdIdx]); + obj.otd.visit(this); break; case TypeDefinitionEnum.I: - this.accept(this.parser.interfaceTypeDefinitions[obj.itdIdx]); + obj.itd.visit(this); break; case TypeDefinitionEnum.U: - this.accept(this.parser.unionTypeDefinitions[obj.utdIdx]); + obj.utd.visit(this); break; case TypeDefinitionEnum.E: - this.accept(this.parser.enumTypeDefinitions[obj.etdIdx]); + obj.etd.visit(this); break; case TypeDefinitionEnum.IO: - this.accept(this.parser.inputObjectTypeDefinitions[obj.iodIdx]); + obj.iod.visit(this); break; } exit(obj); } - void enter(ref const(SchemaDefinition) obj) {} - void exit(ref const(SchemaDefinition) obj) {} + void enter(const(SchemaDefinition) obj) {} + void exit(const(SchemaDefinition) obj) {} - void accept(ref const(SchemaDefinition) obj) { + void accept(const(SchemaDefinition) obj) { enter(obj); final switch(obj.ruleSelection) { case SchemaDefinitionEnum.DO: - this.accept(this.parser.directivess[obj.dirIdx]); - this.accept(this.parser.operationTypeDefinitionss[obj.otdsIdx]); + obj.dir.visit(this); + obj.otds.visit(this); break; case SchemaDefinitionEnum.O: - this.accept(this.parser.operationTypeDefinitionss[obj.otdsIdx]); + obj.otds.visit(this); break; } exit(obj); } - void enter(ref const(OperationTypeDefinitions) obj) {} - void exit(ref const(OperationTypeDefinitions) obj) {} + void enter(const(OperationTypeDefinitions) obj) {} + void exit(const(OperationTypeDefinitions) obj) {} - void accept(ref const(OperationTypeDefinitions) obj) { + void accept(const(OperationTypeDefinitions) obj) { enter(obj); final switch(obj.ruleSelection) { case OperationTypeDefinitionsEnum.O: - this.accept(this.parser.operationTypeDefinitions[obj.otdIdx]); + obj.otd.visit(this); break; case OperationTypeDefinitionsEnum.OCS: - this.accept(this.parser.operationTypeDefinitions[obj.otdIdx]); - this.accept(this.parser.operationTypeDefinitionss[obj.followIdx]); + obj.otd.visit(this); + obj.follow.visit(this); break; case OperationTypeDefinitionsEnum.OS: - this.accept(this.parser.operationTypeDefinitions[obj.otdIdx]); - this.accept(this.parser.operationTypeDefinitionss[obj.followIdx]); + obj.otd.visit(this); + obj.follow.visit(this); break; } exit(obj); } - void enter(ref const(OperationTypeDefinition) obj) {} - void exit(ref const(OperationTypeDefinition) obj) {} + void enter(const(OperationTypeDefinition) obj) {} + void exit(const(OperationTypeDefinition) obj) {} - void accept(ref const(OperationTypeDefinition) obj) { + void accept(const(OperationTypeDefinition) obj) { enter(obj); final switch(obj.ruleSelection) { case OperationTypeDefinitionEnum.O: - this.accept(this.parser.operationTypes[obj.otIdx]); + obj.ot.visit(this); obj.nt.visit(this); break; } exit(obj); } - void enter(ref const(ScalarTypeDefinition) obj) {} - void exit(ref const(ScalarTypeDefinition) obj) {} + void enter(const(ScalarTypeDefinition) obj) {} + void exit(const(ScalarTypeDefinition) obj) {} - void accept(ref const(ScalarTypeDefinition) obj) { + void accept(const(ScalarTypeDefinition) obj) { enter(obj); final switch(obj.ruleSelection) { case ScalarTypeDefinitionEnum.D: obj.name.visit(this); - this.accept(this.parser.directivess[obj.dirIdx]); + obj.dir.visit(this); break; case ScalarTypeDefinitionEnum.S: obj.name.visit(this); @@ -2012,128 +2005,128 @@ class ConstVisitor { exit(obj); } - void enter(ref const(ObjectTypeDefinition) obj) {} - void exit(ref const(ObjectTypeDefinition) obj) {} + void enter(const(ObjectTypeDefinition) obj) {} + void exit(const(ObjectTypeDefinition) obj) {} - void accept(ref const(ObjectTypeDefinition) obj) { + void accept(const(ObjectTypeDefinition) obj) { enter(obj); final switch(obj.ruleSelection) { case ObjectTypeDefinitionEnum.ID: obj.name.visit(this); - this.accept(this.parser.implementsInterfacess[obj.iiIdx]); - this.accept(this.parser.directivess[obj.dirIdx]); - this.accept(this.parser.fieldDefinitionss[obj.fdsIdx]); + obj.ii.visit(this); + obj.dir.visit(this); + obj.fds.visit(this); break; case ObjectTypeDefinitionEnum.I: obj.name.visit(this); - this.accept(this.parser.implementsInterfacess[obj.iiIdx]); - this.accept(this.parser.fieldDefinitionss[obj.fdsIdx]); + obj.ii.visit(this); + obj.fds.visit(this); break; case ObjectTypeDefinitionEnum.D: obj.name.visit(this); - this.accept(this.parser.directivess[obj.dirIdx]); - this.accept(this.parser.fieldDefinitionss[obj.fdsIdx]); + obj.dir.visit(this); + obj.fds.visit(this); break; case ObjectTypeDefinitionEnum.F: obj.name.visit(this); - this.accept(this.parser.fieldDefinitionss[obj.fdsIdx]); + obj.fds.visit(this); break; } exit(obj); } - void enter(ref const(FieldDefinitions) obj) {} - void exit(ref const(FieldDefinitions) obj) {} + void enter(const(FieldDefinitions) obj) {} + void exit(const(FieldDefinitions) obj) {} - void accept(ref const(FieldDefinitions) obj) { + void accept(const(FieldDefinitions) obj) { enter(obj); final switch(obj.ruleSelection) { case FieldDefinitionsEnum.F: - this.accept(this.parser.fieldDefinitions[obj.fdIdx]); + obj.fd.visit(this); break; case FieldDefinitionsEnum.FC: - this.accept(this.parser.fieldDefinitions[obj.fdIdx]); - this.accept(this.parser.fieldDefinitionss[obj.followIdx]); + obj.fd.visit(this); + obj.follow.visit(this); break; case FieldDefinitionsEnum.FNC: - this.accept(this.parser.fieldDefinitions[obj.fdIdx]); - this.accept(this.parser.fieldDefinitionss[obj.followIdx]); + obj.fd.visit(this); + obj.follow.visit(this); break; } exit(obj); } - void enter(ref const(FieldDefinition) obj) {} - void exit(ref const(FieldDefinition) obj) {} + void enter(const(FieldDefinition) obj) {} + void exit(const(FieldDefinition) obj) {} - void accept(ref const(FieldDefinition) obj) { + void accept(const(FieldDefinition) obj) { enter(obj); final switch(obj.ruleSelection) { case FieldDefinitionEnum.AD: obj.name.visit(this); - this.accept(this.parser.argumentsDefinitions[obj.argIdx]); - this.accept(this.parser.types[obj.typIdx]); - this.accept(this.parser.directivess[obj.dirIdx]); + obj.arg.visit(this); + obj.typ.visit(this); + obj.dir.visit(this); break; case FieldDefinitionEnum.A: obj.name.visit(this); - this.accept(this.parser.argumentsDefinitions[obj.argIdx]); - this.accept(this.parser.types[obj.typIdx]); + obj.arg.visit(this); + obj.typ.visit(this); break; case FieldDefinitionEnum.D: obj.name.visit(this); - this.accept(this.parser.types[obj.typIdx]); - this.accept(this.parser.directivess[obj.dirIdx]); + obj.typ.visit(this); + obj.dir.visit(this); break; case FieldDefinitionEnum.T: obj.name.visit(this); - this.accept(this.parser.types[obj.typIdx]); + obj.typ.visit(this); break; case FieldDefinitionEnum.DAD: - this.accept(this.parser.descriptions[obj.desIdx]); + obj.des.visit(this); obj.name.visit(this); - this.accept(this.parser.argumentsDefinitions[obj.argIdx]); - this.accept(this.parser.types[obj.typIdx]); - this.accept(this.parser.directivess[obj.dirIdx]); + obj.arg.visit(this); + obj.typ.visit(this); + obj.dir.visit(this); break; case FieldDefinitionEnum.DA: - this.accept(this.parser.descriptions[obj.desIdx]); + obj.des.visit(this); obj.name.visit(this); - this.accept(this.parser.argumentsDefinitions[obj.argIdx]); - this.accept(this.parser.types[obj.typIdx]); + obj.arg.visit(this); + obj.typ.visit(this); break; case FieldDefinitionEnum.DD: - this.accept(this.parser.descriptions[obj.desIdx]); + obj.des.visit(this); obj.name.visit(this); - this.accept(this.parser.types[obj.typIdx]); - this.accept(this.parser.directivess[obj.dirIdx]); + obj.typ.visit(this); + obj.dir.visit(this); break; case FieldDefinitionEnum.DT: - this.accept(this.parser.descriptions[obj.desIdx]); + obj.des.visit(this); obj.name.visit(this); - this.accept(this.parser.types[obj.typIdx]); + obj.typ.visit(this); break; } exit(obj); } - void enter(ref const(ImplementsInterfaces) obj) {} - void exit(ref const(ImplementsInterfaces) obj) {} + void enter(const(ImplementsInterfaces) obj) {} + void exit(const(ImplementsInterfaces) obj) {} - void accept(ref const(ImplementsInterfaces) obj) { + void accept(const(ImplementsInterfaces) obj) { enter(obj); final switch(obj.ruleSelection) { case ImplementsInterfacesEnum.N: - this.accept(this.parser.namedTypess[obj.ntsIdx]); + obj.nts.visit(this); break; } exit(obj); } - void enter(ref const(NamedTypes) obj) {} - void exit(ref const(NamedTypes) obj) {} + void enter(const(NamedTypes) obj) {} + void exit(const(NamedTypes) obj) {} - void accept(ref const(NamedTypes) obj) { + void accept(const(NamedTypes) obj) { enter(obj); final switch(obj.ruleSelection) { case NamedTypesEnum.N: @@ -2141,20 +2134,20 @@ class ConstVisitor { break; case NamedTypesEnum.NCS: obj.name.visit(this); - this.accept(this.parser.namedTypess[obj.followIdx]); + obj.follow.visit(this); break; case NamedTypesEnum.NS: obj.name.visit(this); - this.accept(this.parser.namedTypess[obj.followIdx]); + obj.follow.visit(this); break; } exit(obj); } - void enter(ref const(ArgumentsDefinition) obj) {} - void exit(ref const(ArgumentsDefinition) obj) {} + void enter(const(ArgumentsDefinition) obj) {} + void exit(const(ArgumentsDefinition) obj) {} - void accept(ref const(ArgumentsDefinition) obj) { + void accept(const(ArgumentsDefinition) obj) { enter(obj); final switch(obj.ruleSelection) { case ArgumentsDefinitionEnum.A: @@ -2165,123 +2158,123 @@ class ConstVisitor { exit(obj); } - void enter(ref const(InputValueDefinitions) obj) {} - void exit(ref const(InputValueDefinitions) obj) {} + void enter(const(InputValueDefinitions) obj) {} + void exit(const(InputValueDefinitions) obj) {} - void accept(ref const(InputValueDefinitions) obj) { + void accept(const(InputValueDefinitions) obj) { enter(obj); final switch(obj.ruleSelection) { case InputValueDefinitionsEnum.I: - this.accept(this.parser.inputValueDefinitions[obj.ivIdx]); + obj.iv.visit(this); break; case InputValueDefinitionsEnum.ICF: - this.accept(this.parser.inputValueDefinitions[obj.ivIdx]); - this.accept(this.parser.inputValueDefinitionss[obj.followIdx]); + obj.iv.visit(this); + obj.follow.visit(this); break; case InputValueDefinitionsEnum.IF: - this.accept(this.parser.inputValueDefinitions[obj.ivIdx]); - this.accept(this.parser.inputValueDefinitionss[obj.followIdx]); + obj.iv.visit(this); + obj.follow.visit(this); break; } exit(obj); } - void enter(ref const(InputValueDefinition) obj) {} - void exit(ref const(InputValueDefinition) obj) {} + void enter(const(InputValueDefinition) obj) {} + void exit(const(InputValueDefinition) obj) {} - void accept(ref const(InputValueDefinition) obj) { + void accept(const(InputValueDefinition) obj) { enter(obj); final switch(obj.ruleSelection) { case InputValueDefinitionEnum.TVD: obj.name.visit(this); - this.accept(this.parser.types[obj.typeIdx]); - this.accept(this.parser.defaultValues[obj.dfIdx]); - this.accept(this.parser.directivess[obj.dirsIdx]); + obj.type.visit(this); + obj.df.visit(this); + obj.dirs.visit(this); break; case InputValueDefinitionEnum.TD: obj.name.visit(this); - this.accept(this.parser.types[obj.typeIdx]); - this.accept(this.parser.directivess[obj.dirsIdx]); + obj.type.visit(this); + obj.dirs.visit(this); break; case InputValueDefinitionEnum.TV: obj.name.visit(this); - this.accept(this.parser.types[obj.typeIdx]); - this.accept(this.parser.defaultValues[obj.dfIdx]); + obj.type.visit(this); + obj.df.visit(this); break; case InputValueDefinitionEnum.T: obj.name.visit(this); - this.accept(this.parser.types[obj.typeIdx]); + obj.type.visit(this); break; case InputValueDefinitionEnum.DTVD: - this.accept(this.parser.descriptions[obj.desIdx]); + obj.des.visit(this); obj.name.visit(this); - this.accept(this.parser.types[obj.typeIdx]); - this.accept(this.parser.defaultValues[obj.dfIdx]); - this.accept(this.parser.directivess[obj.dirsIdx]); + obj.type.visit(this); + obj.df.visit(this); + obj.dirs.visit(this); break; case InputValueDefinitionEnum.DTD: - this.accept(this.parser.descriptions[obj.desIdx]); + obj.des.visit(this); obj.name.visit(this); - this.accept(this.parser.types[obj.typeIdx]); - this.accept(this.parser.directivess[obj.dirsIdx]); + obj.type.visit(this); + obj.dirs.visit(this); break; case InputValueDefinitionEnum.DTV: - this.accept(this.parser.descriptions[obj.desIdx]); + obj.des.visit(this); obj.name.visit(this); - this.accept(this.parser.types[obj.typeIdx]); - this.accept(this.parser.defaultValues[obj.dfIdx]); + obj.type.visit(this); + obj.df.visit(this); break; case InputValueDefinitionEnum.DT: - this.accept(this.parser.descriptions[obj.desIdx]); + obj.des.visit(this); obj.name.visit(this); - this.accept(this.parser.types[obj.typeIdx]); + obj.type.visit(this); break; } exit(obj); } - void enter(ref const(InterfaceTypeDefinition) obj) {} - void exit(ref const(InterfaceTypeDefinition) obj) {} + void enter(const(InterfaceTypeDefinition) obj) {} + void exit(const(InterfaceTypeDefinition) obj) {} - void accept(ref const(InterfaceTypeDefinition) obj) { + void accept(const(InterfaceTypeDefinition) obj) { enter(obj); final switch(obj.ruleSelection) { case InterfaceTypeDefinitionEnum.NDF: obj.name.visit(this); - this.accept(this.parser.directivess[obj.dirsIdx]); - this.accept(this.parser.fieldDefinitionss[obj.fdsIdx]); + obj.dirs.visit(this); + obj.fds.visit(this); break; case InterfaceTypeDefinitionEnum.NF: obj.name.visit(this); - this.accept(this.parser.fieldDefinitionss[obj.fdsIdx]); + obj.fds.visit(this); break; } exit(obj); } - void enter(ref const(UnionTypeDefinition) obj) {} - void exit(ref const(UnionTypeDefinition) obj) {} + void enter(const(UnionTypeDefinition) obj) {} + void exit(const(UnionTypeDefinition) obj) {} - void accept(ref const(UnionTypeDefinition) obj) { + void accept(const(UnionTypeDefinition) obj) { enter(obj); final switch(obj.ruleSelection) { case UnionTypeDefinitionEnum.NDU: obj.name.visit(this); - this.accept(this.parser.directivess[obj.dirsIdx]); - this.accept(this.parser.unionMemberss[obj.umIdx]); + obj.dirs.visit(this); + obj.um.visit(this); break; case UnionTypeDefinitionEnum.NU: obj.name.visit(this); - this.accept(this.parser.unionMemberss[obj.umIdx]); + obj.um.visit(this); break; } exit(obj); } - void enter(ref const(UnionMembers) obj) {} - void exit(ref const(UnionMembers) obj) {} + void enter(const(UnionMembers) obj) {} + void exit(const(UnionMembers) obj) {} - void accept(ref const(UnionMembers) obj) { + void accept(const(UnionMembers) obj) { enter(obj); final switch(obj.ruleSelection) { case UnionMembersEnum.S: @@ -2289,137 +2282,137 @@ class ConstVisitor { break; case UnionMembersEnum.SPF: obj.name.visit(this); - this.accept(this.parser.unionMemberss[obj.followIdx]); + obj.follow.visit(this); break; case UnionMembersEnum.SF: obj.name.visit(this); - this.accept(this.parser.unionMemberss[obj.followIdx]); + obj.follow.visit(this); break; } exit(obj); } - void enter(ref const(EnumTypeDefinition) obj) {} - void exit(ref const(EnumTypeDefinition) obj) {} + void enter(const(EnumTypeDefinition) obj) {} + void exit(const(EnumTypeDefinition) obj) {} - void accept(ref const(EnumTypeDefinition) obj) { + void accept(const(EnumTypeDefinition) obj) { enter(obj); final switch(obj.ruleSelection) { case EnumTypeDefinitionEnum.NDE: obj.name.visit(this); - this.accept(this.parser.directivess[obj.dirIdx]); - this.accept(this.parser.enumValueDefinitionss[obj.evdsIdx]); + obj.dir.visit(this); + obj.evds.visit(this); break; case EnumTypeDefinitionEnum.NE: obj.name.visit(this); - this.accept(this.parser.enumValueDefinitionss[obj.evdsIdx]); + obj.evds.visit(this); break; } exit(obj); } - void enter(ref const(EnumValueDefinitions) obj) {} - void exit(ref const(EnumValueDefinitions) obj) {} + void enter(const(EnumValueDefinitions) obj) {} + void exit(const(EnumValueDefinitions) obj) {} - void accept(ref const(EnumValueDefinitions) obj) { + void accept(const(EnumValueDefinitions) obj) { enter(obj); final switch(obj.ruleSelection) { case EnumValueDefinitionsEnum.D: - this.accept(this.parser.enumValueDefinitions[obj.evdIdx]); + obj.evd.visit(this); break; case EnumValueDefinitionsEnum.DCE: - this.accept(this.parser.enumValueDefinitions[obj.evdIdx]); - this.accept(this.parser.enumValueDefinitionss[obj.followIdx]); + obj.evd.visit(this); + obj.follow.visit(this); break; case EnumValueDefinitionsEnum.DE: - this.accept(this.parser.enumValueDefinitions[obj.evdIdx]); - this.accept(this.parser.enumValueDefinitionss[obj.followIdx]); + obj.evd.visit(this); + obj.follow.visit(this); break; } exit(obj); } - void enter(ref const(EnumValueDefinition) obj) {} - void exit(ref const(EnumValueDefinition) obj) {} + void enter(const(EnumValueDefinition) obj) {} + void exit(const(EnumValueDefinition) obj) {} - void accept(ref const(EnumValueDefinition) obj) { + void accept(const(EnumValueDefinition) obj) { enter(obj); final switch(obj.ruleSelection) { case EnumValueDefinitionEnum.ED: obj.name.visit(this); - this.accept(this.parser.directivess[obj.dirsIdx]); + obj.dirs.visit(this); break; case EnumValueDefinitionEnum.E: obj.name.visit(this); break; case EnumValueDefinitionEnum.DED: - this.accept(this.parser.descriptions[obj.desIdx]); + obj.des.visit(this); obj.name.visit(this); - this.accept(this.parser.directivess[obj.dirsIdx]); + obj.dirs.visit(this); break; case EnumValueDefinitionEnum.DE: - this.accept(this.parser.descriptions[obj.desIdx]); + obj.des.visit(this); obj.name.visit(this); break; } exit(obj); } - void enter(ref const(InputTypeDefinition) obj) {} - void exit(ref const(InputTypeDefinition) obj) {} + void enter(const(InputTypeDefinition) obj) {} + void exit(const(InputTypeDefinition) obj) {} - void accept(ref const(InputTypeDefinition) obj) { + void accept(const(InputTypeDefinition) obj) { enter(obj); final switch(obj.ruleSelection) { case InputTypeDefinitionEnum.NDE: obj.name.visit(this); - this.accept(this.parser.directivess[obj.dirIdx]); - this.accept(this.parser.inputValueDefinitionss[obj.ivdsIdx]); + obj.dir.visit(this); + obj.ivds.visit(this); break; case InputTypeDefinitionEnum.NE: obj.name.visit(this); - this.accept(this.parser.inputValueDefinitionss[obj.ivdsIdx]); + obj.ivds.visit(this); break; } exit(obj); } - void enter(ref const(TypeExtensionDefinition) obj) {} - void exit(ref const(TypeExtensionDefinition) obj) {} + void enter(const(TypeExtensionDefinition) obj) {} + void exit(const(TypeExtensionDefinition) obj) {} - void accept(ref const(TypeExtensionDefinition) obj) { + void accept(const(TypeExtensionDefinition) obj) { enter(obj); final switch(obj.ruleSelection) { case TypeExtensionDefinitionEnum.O: - this.accept(this.parser.objectTypeDefinitions[obj.otdIdx]); + obj.otd.visit(this); break; } exit(obj); } - void enter(ref const(DirectiveDefinition) obj) {} - void exit(ref const(DirectiveDefinition) obj) {} + void enter(const(DirectiveDefinition) obj) {} + void exit(const(DirectiveDefinition) obj) {} - void accept(ref const(DirectiveDefinition) obj) { + void accept(const(DirectiveDefinition) obj) { enter(obj); final switch(obj.ruleSelection) { case DirectiveDefinitionEnum.AD: obj.name.visit(this); - this.accept(this.parser.argumentsDefinitions[obj.adIdx]); - this.accept(this.parser.directiveLocationss[obj.dlIdx]); + obj.ad.visit(this); + obj.dl.visit(this); break; case DirectiveDefinitionEnum.D: obj.name.visit(this); - this.accept(this.parser.directiveLocationss[obj.dlIdx]); + obj.dl.visit(this); break; } exit(obj); } - void enter(ref const(DirectiveLocations) obj) {} - void exit(ref const(DirectiveLocations) obj) {} + void enter(const(DirectiveLocations) obj) {} + void exit(const(DirectiveLocations) obj) {} - void accept(ref const(DirectiveLocations) obj) { + void accept(const(DirectiveLocations) obj) { enter(obj); final switch(obj.ruleSelection) { case DirectiveLocationsEnum.N: @@ -2427,25 +2420,25 @@ class ConstVisitor { break; case DirectiveLocationsEnum.NPF: obj.name.visit(this); - this.accept(this.parser.directiveLocationss[obj.followIdx]); + obj.follow.visit(this); break; case DirectiveLocationsEnum.NF: obj.name.visit(this); - this.accept(this.parser.directiveLocationss[obj.followIdx]); + obj.follow.visit(this); break; } exit(obj); } - void enter(ref const(InputObjectTypeDefinition) obj) {} - void exit(ref const(InputObjectTypeDefinition) obj) {} + void enter(const(InputObjectTypeDefinition) obj) {} + void exit(const(InputObjectTypeDefinition) obj) {} - void accept(ref const(InputObjectTypeDefinition) obj) { + void accept(const(InputObjectTypeDefinition) obj) { enter(obj); final switch(obj.ruleSelection) { case InputObjectTypeDefinitionEnum.NDI: obj.name.visit(this); - this.accept(this.parser.directivess[obj.dirsIdx]); + obj.dirs.visit(this); break; case InputObjectTypeDefinitionEnum.NI: obj.name.visit(this); @@ -2454,10 +2447,10 @@ class ConstVisitor { exit(obj); } - void enter(ref const(Description) obj) {} - void exit(ref const(Description) obj) {} + void enter(const(Description) obj) {} + void exit(const(Description) obj) {} - void accept(ref const(Description) obj) { + void accept(const(Description) obj) { enter(obj); final switch(obj.ruleSelection) { case DescriptionEnum.S: