示例#1
0
 private void StartModel(string name, bool isPartial, Span span)
 {
     Contract.Requires(currentModule == null);
     currentModule = new Model(span, name, isPartial);
     parseResult.Program.Node.AddModule(currentModule);
     crntModRefState = ModRefState.Other;
 }
示例#2
0
        private void StartMachine(string name, Span span)
        {
            Contract.Requires(currentModule == null);
            var mach = new Machine(span, name);

            parseResult.Program.Node.AddModule(mach);
            currentModule   = mach;
            crntModRefState = ModRefState.Input;
        }
示例#3
0
        private void StartTSystem(string name, Span span)
        {
            Contract.Requires(currentModule == null);
            var tsys = new TSystem(span, name);

            parseResult.Program.Node.AddModule(tsys);
            crntModRefState = ModRefState.Input;
            currentModule   = tsys;
        }
示例#4
0
        private void StartDomain(string name, ComposeKind kind, Span span)
        {
            Contract.Requires(currentModule == null);
            var dom = new Domain(span, name, kind);

            parseResult.Program.Node.AddModule(dom);
            currentModule   = dom;
            crntModRefState = ModRefState.Other;
        }
示例#5
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;
        }
示例#6
0
 private void SetModRefState(ModRefState state)
 {
     crntModRefState = state;
 }
示例#7
0
 private void EndModule()
 {
     Contract.Requires(currentModule != null);
     currentModule   = null;
     crntModRefState = ModRefState.None;
 }