예제 #1
0
 public override void write(CCodeWriter writer)
 {
     writer.write_indent(line);
     writer.write_string("case ");
     expression.write(writer);
     writer.write_string(":");
     writer.write_newline();
 }
예제 #2
0
 public override void write(CCodeWriter writer)
 {
     writer.write_indent();
     writer.write_string("goto ");
     writer.write_string(name);
     writer.write_string(";");
     writer.write_newline();
 }
예제 #3
0
 private void write_expression(CCodeWriter writer, CCodeExpression expr)
 {
     writer.write_indent(line);
     if (expr != null)
     {
         expr.write(writer);
     }
     writer.write_string(";");
     writer.write_newline();
 }
예제 #4
0
        public override void write(CCodeWriter writer)
        {
            if (name != null)
            {
                writer.write_string("typedef ");
            }
            writer.write_string("enum ");
            writer.write_begin_block();
            bool first = true;

            foreach (CCodeEnumValue value in values)
            {
                if (!first)
                {
                    writer.write_string(",");
                    writer.write_newline();
                }
                writer.write_indent();
                value.write(writer);
                first = false;
            }
            if (!first)
            {
                writer.write_newline();
            }
            writer.write_end_block();
            if (name != null)
            {
                writer.write_string(" ");
                writer.write_string(name);
            }
            if (modifiers.HasFlag(CCodeModifiers.DEPRECATED))
            {
                writer.write_string(" G_GNUC_DEPRECATED");
            }
            writer.write_string(";");
            writer.write_newline();
        }
예제 #5
0
        public override void write(CCodeWriter writer)
        {
            writer.write_indent(line);
            writer.write_string("return");

            if (return_expression != null)
            {
                writer.write_string(" ");
                return_expression.write(writer);
            }

            writer.write_string(";");
            writer.write_newline();
        }
예제 #6
0
 public override void write(CCodeWriter writer)
 {
     writer.write_indent(line);
     writer.write_string("break;");
     writer.write_newline();
 }