Exemplo n.º 1
0
        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;
        }
Exemplo n.º 2
0
        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;
        }
Exemplo n.º 3
0
 private void StartEnum(Span span)
 {
     Contract.Requires(currentEnum == null);
     currentEnum = new Nodes.Enum(span);
 }