private void ResetState() { currentModule = null; parseResult.ClearFlags(); /******* State for building terms ********/ appStack.Clear(); argStack.Clear(); quoteStack.Clear(); /*****************************************/ /******* State for building rules, contracts, and comprehensions ********/ crntRule = null; crntContract = null; crntBody = null; /*****************************************/ /******* State for building types and type declarations ********/ crntTypeDeclName = null; crntTypeDeclSpan = default(Span); crntTypeDecl = null; crntTypeTerm = null; currentEnum = null; /*****************************************/ /******* State for ModRefs, steps, and updates ********/ crntModRef = null; crntStep = null; crntUpdate = null; crntModRefState = ModRefState.None; /*************************************/ /******* State for sentence configs ********/ crntSentConf = null; /*************************************/ IsBuildingNext = false; IsBuildingUpdate = false; IsBuildingCod = false; }
private void EndEnum() { Contract.Requires(currentEnum != null); Contract.Ensures(currentEnum == null); if (crntTypeTerm == null) { crntTypeTerm = currentEnum; } else if (crntTypeTerm.NodeKind == NodeKind.Union) { ((Union)crntTypeTerm).AddComponent(currentEnum); } else { var unn = new Union(crntTypeTerm.Span); unn.AddComponent(crntTypeTerm); unn.AddComponent(currentEnum); crntTypeTerm = unn; } currentEnum = null; }
private void StartEnum(Span span) { Contract.Requires(currentEnum == null); currentEnum = new Nodes.Enum(span); }