Example #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");
                }
            }
        }
Example #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;
 }
Example #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;
 }
Example #4
0
 public ParametersSection(DeclarationList decls = null)
     : base(decls)
 {
     returnVar = null;
     if (decls == null)
     {
         decls = new DeclarationList();
     }
 }
Example #5
0
 public void AddProperties(DeclarationList fs, Scope s)
 {
     if (fs != null)
     {
         foreach (PropertyDeclaration d in fs)
         {
             d.SetScope(s);
         }
     }
     properties.Add(fs);
 }
Example #6
0
 public void AddFields(DeclarationList fs, Scope s)
 {
     if (fs != null)
     {
         foreach (FieldDeclaration d in fs)
         {
             d.SetScope(s);
         }
     }
     fields.Add(fs);
 }
Example #7
0
 public void AddMethods(DeclarationList fs, Scope s)
 {
     if (fs != null)
     {
         foreach (MethodDeclaration d in fs)
         {
             d.SetScope(s);
         }
     }
     decls.Add(fs);
 }
Example #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;
             }
         }
     }
 }
Example #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);
                }
            }
        }
Example #10
0
 public TopLevelDeclarationSection(NodeList uses, DeclarationList decls)
     : base(decls)
 {
     this.uses = uses;
 }
Example #11
0
 public ImplementationSection(NodeList uses, DeclarationList decls) : base(uses, decls)
 {
 }
Example #12
0
 public ProgramSection(NodeList uses, DeclarationList decls, BlockStatement code)
     : base(uses, decls)
 {
     this.block = code;
 }
Example #13
0
 public RecordType(DeclarationList compTypes)
 {
     this.compTypes = compTypes;
 }
Example #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);
 }
Example #15
0
 public VariantDeclaration(String id, RangeType t, DeclarationList varfields)
     : this(id, (VariableType)t, varfields)
 {
 }
Example #16
0
 public InterfaceSection(NodeList uses, DeclarationList decls) : base(uses, decls)
 {
 }
Example #17
0
 public Section()
 {
     decls = new DeclarationList();
 }
Example #18
0
 public LibraryNode(String name, NodeList uses, DeclarationList decls, BlockStatement body)
     : base((name == null)? "$untitled$" : name)
 {
     section = new ProgramSection(uses, decls, body);
 }
Example #19
0
 public RoutineSection(DeclarationList decls, Statement block)
     : base(decls)
 {
     this.block = block;
 }