コード例 #1
0
ファイル: Root.cs プロジェクト: dlebansais/Easly-Controller
 public Root(Document documentation)
     : base(documentation)
 {
     UnassignedOptionalMain = new OptionalReference <Main>(new Main());
     LeafPathH = new List <Leaf>();
     LeafPathV = new List <Leaf>();
     UnassignedOptionalLeaf = new OptionalReference <Leaf>(new Leaf());
 }
コード例 #2
0
ファイル: Main.cs プロジェクト: dlebansais/Easly-Controller
 public Main(Document document)
     : base(document)
 {
     UnassignedOptionalLeaf = new OptionalReference <Leaf>(new Leaf());
     EmptyOptionalLeaf      = new OptionalReference <Leaf>(new Leaf());
     AssignedOptionalTree   = new OptionalReference <Tree>(new Tree());
     AssignedOptionalLeaf   = new OptionalReference <Leaf>(new Leaf());
     //LeafBlocks = new BlockList<Leaf>();
     LeafPath = new List <Leaf>();
 }
コード例 #3
0
ファイル: Main.cs プロジェクト: dlebansais/Easly-Controller
 public Main()
     : base(NodeHelper.CreateEmptyDocument())
 {
     UnassignedOptionalLeaf = new OptionalReference <Leaf>(new Leaf());
     EmptyOptionalLeaf      = new OptionalReference <Leaf>(new Leaf());
     AssignedOptionalTree   = new OptionalReference <Tree>(new Tree());
     AssignedOptionalLeaf   = new OptionalReference <Leaf>(new Leaf());
     //LeafBlocks = new BlockList<Leaf>();
     LeafPath = new List <Leaf>();
 }
コード例 #4
0
ファイル: Class.cs プロジェクト: dlebansais/Easly-Compiler
        /// <summary>
        /// Reset some intermediate results.
        /// </summary>
        /// <param name="ruleTemplateList">The list of rule templates that would read the properties to reset.</param>
        public void Reset(IRuleTemplateList ruleTemplateList)
        {
            bool IsHandled = false;

            if (ruleTemplateList == RuleTemplateSet.Identifiers)
            {
                IsHandled = true;
            }
            else if (ruleTemplateList == RuleTemplateSet.Types)
            {
                LocalGenericTable       = new SealableDictionary <string, ICompiledType>();
                GenericTable            = new SealableDictionary <string, ICompiledType>();
                LocalDiscreteTable      = new SealableDictionary <IFeatureName, IDiscrete>();
                DiscreteTable           = new SealableDictionary <IFeatureName, IDiscrete>();
                DiscreteWithValueTable  = new SealableDictionary <IFeatureName, IExpression>();
                LocalTypedefTable       = new SealableDictionary <IFeatureName, ITypedefType>();
                TypedefTable            = new SealableDictionary <IFeatureName, ITypedefType>();
                LocalFeatureTable       = new SealableDictionary <IFeatureName, IFeatureInstance>();
                FeatureTable            = new SealableDictionary <IFeatureName, IFeatureInstance>();
                InheritedClassTypeTable = new SealableDictionary <IClassType, IObjectType>();
                LocalNamespaceTable     = new SealableDictionary <string, ISealableDictionary>();
                LocalExportTable        = new SealableDictionary <IFeatureName, ISealableDictionary <string, IClass> >();
                ExportTable             = new SealableDictionary <IFeatureName, ISealableDictionary <string, IClass> >();
                ConversionFromTable     = new SealableDictionary <IFeatureName, ICreationFeature>();
                ConversionToTable       = new SealableDictionary <IFeatureName, IFunctionFeature>();
                ResolvedClassTypeName   = new OnceReference <ITypeName>();
                ResolvedClassType       = new OnceReference <IClassType>();
                GenericInstanceList     = new List <IClassType>();
                TypeTable                  = new SealableDictionary <ITypeName, ICompiledType>();
                ClassIndexer               = new OptionalReference <IIndexerFeature>();
                ClassGroupList             = new SealableList <IClass>();
                ClassGroup                 = new OnceReference <SingleClassGroup>();
                InheritanceTable           = new SealableDictionary <ITypeName, ICompiledType>();
                ResolvedImportedClassTable = new SealableDictionary <ITypeName, IClassType>();
                ResolvedAsCompiledType     = new OnceReference <ICompiledType>();
                BodyList                   = new List <IBody>();
                CommandOverloadList        = new List <ICommandOverload>();
                QueryOverloadList          = new List <IQueryOverload>();
                NodeWithDefaultList        = new List <IExpression>();
                NodeWithNumberConstantList = new List <IExpression>();
                ImportedLanguageTypeTable  = new Dictionary <Guid, Tuple <ITypeName, IClassType> >();
                NamespaceTable             = new SealableDictionary <string, ISealableDictionary>();
                LocalScope                 = new SealableDictionary <string, IScopeAttributeFeature>();
                LocalScope.Seal();
                InnerScopes = new List <IScopeHolder>();
                FullScope   = new SealableDictionary <string, IScopeAttributeFeature>();
                IsHandled   = true;
            }
            else if (ruleTemplateList == RuleTemplateSet.Contract)
            {
                AdditionalScope = new SealableDictionary <string, IScopeAttributeFeature>();
                AdditionalScope.Seal();
                ResolvedBodyTagList                = new OnceReference <IList <IBody> >();
                ResolvedNodeWithDefaultList        = new OnceReference <IList <IExpression> >();
                ResolvedNodeWithNumberConstantList = new OnceReference <IList <IExpression> >();
                InheritedBodyTagListTable          = new SealableDictionary <IClassType, IList <IBody> >();
                InitializedObjectList              = new List <IInitializedObjectExpression>();
                IsHandled = true;
            }
            else if (ruleTemplateList == RuleTemplateSet.Body)
            {
                ResolvedBodyList      = new OnceReference <IList <IBody> >();
                AssignedDiscreteTable = new SealableDictionary <IDiscrete, string>();
                IsHandled             = true;
            }

            Debug.Assert(IsHandled);
        }