public static CCodeDeclaratorSuffix with_array(CCodeExpression array_length = null)
        {
            CCodeDeclaratorSuffix @this = new CCodeDeclaratorSuffix();

            @this.array_length = array_length;
            @this.array        = true;
            return(@this);
        }
Exemple #2
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);
        }
        public static CCodeVariableDeclarator zero(string name, CCodeExpression initializer, CCodeDeclaratorSuffix declarator_suffix = null)
        {
            CCodeVariableDeclarator @this = new CCodeVariableDeclarator(name, initializer, declarator_suffix);

            @this.init0 = true;
            return(@this);
        }
 public CCodeVariableDeclarator(string name, CCodeExpression initializer = null, CCodeDeclaratorSuffix declarator_suffix = null)
 {
     this.name              = name;
     this.initializer       = initializer;
     this.declarator_suffix = declarator_suffix;
 }