Ejemplo n.º 1
0
        /// <summary>
        /// Adds a variable with the specified type and name to this struct.
        ///
        /// <param name="type_name">field type</param>
        /// <param name="name">member name</param>
        /// </summary>
        public void add_field(string type_name, string name, CCodeModifiers modifiers = 0, CCodeDeclaratorSuffix declarator_suffix = null)
        {
            var decl = new CCodeDeclaration(type_name);

            decl.add_declarator(new CCodeVariableDeclarator(name, null, declarator_suffix));
            decl.modifiers = modifiers;
            add_declaration(decl);
        }
Ejemplo n.º 2
0
        public void add_declaration(string type_name, CCodeDeclarator declarator, CCodeModifiers modifiers = 0)
        {
            var stmt = new CCodeDeclaration(type_name);

            stmt.add_declarator(declarator);
            stmt.modifiers = modifiers;
            add_statement(stmt);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Adds the specified declaration as member to this struct.
 ///
 /// <param name="decl">a variable declaration</param>
 /// </summary>
 public void add_declaration(CCodeDeclaration decl)
 {
     declarations.Add(decl);
 }