Package relaxngcc.codedom

# Class CDBlock

java.lang.Object
relaxngcc.codedom.CDBlock

All Implemented Interfaces:
  `CDStatement`

public class CDBlock extends Object implements CDStatement

Author:
  Daisuke OKAJIMA simple collection of CDStatement objects

## Constructor Summary

Constructors
Constructor
Description
`CDBlock()`
`CDBlock(CDStatement s)`

## Method Summary

Modifier and Type
Method
Description
`CDIfStatement`
`_if(CDExpression exp)`
`void`
`_return(CDExpression val)`
Adds a new return statement.
`void`
`add(CDBlock sv)`
`void`
`add(CDStatement s)`
`CDAssignStatement`
`assign(CDExpression lhs, CDExpression rhs)`
Adds a new assignment.
`CDVariable`
`decl(CDType type, String name)`
Adds a new variable declaration.
`CDVariable`
`decl(CDType type, String name, CDExpression init)`
`CDVariable`
`insertDecl(CDType type, String name)`
Declares a new variable at the beginning of the block.
`CDMethodInvokeExpression`
`invoke(String method)`
`CDMethodInvokeExpression`
`invoke(CDExpression obj, String method)`
Adds a new method invocation.
`int`
`size()`
`void`
`state(CDFormatter f)`
Prints itself as a statement.

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### CDBlock

public CDBlock()

### CDBlock

public CDBlock(CDStatement s)

## Method Details

### add

public void add(CDStatement s)

### add

public void add(CDBlock sv)

### _if

public CDIfStatement _if(CDExpression exp)

### invoke

public CDMethodInvokeExpression invoke(CDExpression obj, String method)
Adds a new method invocation.

### invoke

public CDMethodInvokeExpression invoke(String method)

### decl

public CDVariable decl(CDType type, String name)
Adds a new variable declaration.

### decl

public CDVariable decl(CDType type, String name, CDExpression init)

### insertDecl

public CDVariable insertDecl(CDType type, String name)
Declares a new variable at the beginning of the block.

### assign

public CDAssignStatement assign(CDExpression lhs, CDExpression rhs)
Adds a new assignment.

### _return

public void _return(CDExpression val)
Adds a new return statement.

### size

public int size()

### state

public void state(CDFormatter f) throws IOException
Description copied from interface: `CDStatement`
Prints itself as a statement.

Specified by:
  `state` in interface `CDStatement`
Throws:
  `IOException`