ac.essex.ooechs.ecj.ecj2java.nodes
Interface ParseableNode

All Known Implementing Classes:
Number, ParseableERC, ParseableGPNode, X

public interface ParseableNode

Basic Interface that allows the JavaWriter to turn GP nodes into Java Code. It allows the JavaWriter to assign names to each function (for variable declaration) and allows it to access the GP node's children.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version, provided that any use properly credits the author. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details at http://www.gnu.org

Version:
1.0
Author:
Olly Oechsle, University of Essex, Date: 05-Sep-2006
See Also:
ParseableERC, ParseableGPNode

Field Summary
static int BOOLEAN
           
static int DOUBLE
           
static int ERC
           
static int FUNCTION
           
static int INT
           
static int RETURN
           
static int VOID
           
 
Method Summary
 int countChildren()
          Returns how many children this node has
 ParseableNode getChild(int index)
          Gets the child of this node at a given index.
 java.lang.String getJavaCode()
          Writes out the java for this node
 java.lang.String getLineComment()
          There may be a line comment associated with this piece of code.
 int getObjectType()
          The kind of object this is, eg int, double, etc.
 int getType()
          Returns what kind of node this is.
 java.lang.String getVariableName()
          When the java writer uses this node, it may use a variable name to refer to it.
 void setType(int type)
          Set the node type
 void setVariableName(java.lang.String name)
          Attaches a variable name to this node, (performed automatically by JavaWriter).
 

Field Detail

FUNCTION

static final int FUNCTION
See Also:
Constant Field Values

ERC

static final int ERC
See Also:
Constant Field Values

VOID

static final int VOID
See Also:
Constant Field Values

RETURN

static final int RETURN
See Also:
Constant Field Values

BOOLEAN

static final int BOOLEAN
See Also:
Constant Field Values

DOUBLE

static final int DOUBLE
See Also:
Constant Field Values

INT

static final int INT
See Also:
Constant Field Values
Method Detail

getVariableName

java.lang.String getVariableName()
When the java writer uses this node, it may use a variable name to refer to it.


setVariableName

void setVariableName(java.lang.String name)
Attaches a variable name to this node, (performed automatically by JavaWriter).


getChild

ParseableNode getChild(int index)
Gets the child of this node at a given index.


countChildren

int countChildren()
Returns how many children this node has


getType

int getType()
Returns what kind of node this is.


setType

void setType(int type)
Set the node type


getObjectType

int getObjectType()
The kind of object this is, eg int, double, etc.


getLineComment

java.lang.String getLineComment()
There may be a line comment associated with this piece of code.


getJavaCode

java.lang.String getJavaCode()
Writes out the java for this node