예제 #1
0
        /// <summary>
        /// Add unknown-type declarations
        /// </summary>
        public void AddDecls(DeclarationList fs, Scope s = 0)
        {
            if (fs == null)
            {
                return;
            }

            if (s != 0)
            {
                foreach (IScopedDeclaration d in fs)
                {
                    d.SetScope(s);
                }
            }

            foreach (var d in fs)
            {
                if (d is MethodDeclaration)
                {
                    decls.Add(d);
                }
                else if (d is PropertyDeclaration)                      // a property is a field too
                {
                    properties.Add(d);
                }
                else if (d is FieldDeclaration)                 // a property is a field too
                {
                    fields.Add(d);
                }
                else
                {
                    ErrorInternal("Unknown Declaration in ObjectSection AddDecls");
                }
            }
        }
예제 #2
0
 public ArrayProperty(String ident, TypeNode type, DeclarationList indexes,
                      PropertySpecifiers specs, bool def)
     : base(ident, type, specs)
 {
     this.indexes    = indexes;
     this.specifiers = specs;
     this.isDefault  = def;
 }
예제 #3
0
 public VariantDeclaration(String id, VariableType t, DeclarationList varfields)
     : base(id, t)
 {
     // TODO
     ///	if (!(t is IOrdinalType))
     //		throw new TypeRequiredException("Ordinal");
     this.varfields = varfields;
 }
예제 #4
0
 public ParametersSection(DeclarationList decls = null)
     : base(decls)
 {
     returnVar = null;
     if (decls == null)
     {
         decls = new DeclarationList();
     }
 }
예제 #5
0
 public void AddProperties(DeclarationList fs, Scope s)
 {
     if (fs != null)
     {
         foreach (PropertyDeclaration d in fs)
         {
             d.SetScope(s);
         }
     }
     properties.Add(fs);
 }
예제 #6
0
 public void AddFields(DeclarationList fs, Scope s)
 {
     if (fs != null)
     {
         foreach (FieldDeclaration d in fs)
         {
             d.SetScope(s);
         }
     }
     fields.Add(fs);
 }
예제 #7
0
 public void AddMethods(DeclarationList fs, Scope s)
 {
     if (fs != null)
     {
         foreach (MethodDeclaration d in fs)
         {
             d.SetScope(s);
         }
     }
     decls.Add(fs);
 }
예제 #8
0
 public Section(DeclarationList dls)
 {
     decls = dls;
     if (decls == null)
     {
         decls = new DeclarationList();
     }
     else
     {
         foreach (var d in decls)
         {
             if (d is CallableDeclaration)
             {
                 (d as CallableDeclaration).declaringSection = this;
             }
         }
     }
 }
예제 #9
0
        // Kept in the baseclass, 'decls' list
        //	public DeclarationList methods;

        public ObjectSection(DeclarationList fs = null, DeclarationList ds = null, Scope s = Scope.Published)
            : base(new DeclarationList())
        {
            fields = fs;
            if (fields == null)
            {
                fields = new DeclarationList();
            }
            properties = new DeclarationList();

            AddDecls(ds, s);                    // methods and properties

            if (Enum.IsDefined(typeof(Scope), s))
            {
                foreach (FieldDeclaration d in fields)
                {
                    d.SetScope(s);
                }
            }
        }
예제 #10
0
 public TopLevelDeclarationSection(NodeList uses, DeclarationList decls)
     : base(decls)
 {
     this.uses = uses;
 }
예제 #11
0
 public ImplementationSection(NodeList uses, DeclarationList decls) : base(uses, decls)
 {
 }
예제 #12
0
 public ProgramSection(NodeList uses, DeclarationList decls, BlockStatement code)
     : base(uses, decls)
 {
     this.block = code;
 }
예제 #13
0
 public RecordType(DeclarationList compTypes)
 {
     this.compTypes = compTypes;
 }
예제 #14
0
 public VarEntryDeclaration(Expression tagvalue, DeclarationList fields)
     : base(null, null)                  // type must be later set to the variant type
 {
     this.tagvalue = tagvalue;
     this.fields   = new RecordType(fields);
 }
예제 #15
0
 public VariantDeclaration(String id, RangeType t, DeclarationList varfields)
     : this(id, (VariableType)t, varfields)
 {
 }
예제 #16
0
 public InterfaceSection(NodeList uses, DeclarationList decls) : base(uses, decls)
 {
 }
예제 #17
0
 public Section()
 {
     decls = new DeclarationList();
 }
예제 #18
0
 public LibraryNode(String name, NodeList uses, DeclarationList decls, BlockStatement body)
     : base((name == null)? "$untitled$" : name)
 {
     section = new ProgramSection(uses, decls, body);
 }
예제 #19
0
 public RoutineSection(DeclarationList decls, Statement block)
     : base(decls)
 {
     this.block = block;
 }