コード例 #1
0
        public static CCodeDeclaratorSuffix with_array(CCodeExpression array_length = null)
        {
            CCodeDeclaratorSuffix @this = new CCodeDeclaratorSuffix();

            @this.array_length = array_length;
            @this.array        = true;
            return(@this);
        }
コード例 #2
0
ファイル: CCodeStruct.cs プロジェクト: smx-smx/ValaSharp
        /// <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);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
 public CCodeVariableDeclarator(string name, CCodeExpression initializer = null, CCodeDeclaratorSuffix declarator_suffix = null)
 {
     this.name              = name;
     this.initializer       = initializer;
     this.declarator_suffix = declarator_suffix;
 }