package parser.command;

import parser.ParserException;
import parser.SlogoParser;
import parser.command.tree.CommandTreeNode;

public abstract class Command implements Evaluable{
	
	protected CommandTreeNode myTree;
	protected SlogoParser myParser;
	protected CommandElement myCommand;
	
	public static final boolean DEBUG = true;
	
	public Command(){
		myTree = null;
		myParser = null;
		myCommand = null;
	}
	
	public Command(CommandTreeNode tree, SlogoParser parser, CommandElement command){
		setParameters(tree, parser, command);
	}
	
	@Override
	public void setParameters(CommandTreeNode tree, SlogoParser parser, CommandElement command){
		myTree = tree;
		myParser = parser;
		myCommand = command;
		if(DEBUG){
			System.out.println("Initializing: " + myCommand.getNativeCommand());
		}
	}
	
	@Override
	public CommandList build() throws ParserException{
		return myTree.getRemainder();
	}
	
	@Override
	public CommandElement getCommandElement(){
		return myCommand;
	}
	
	@Override
	public String toString(){
		return myCommand.getRawText();
	}
	
	@Override
	public String toString(boolean useDelimiter){
		return myCommand.getRawText();
	}
}

@@ -323,11 +323,12 @@
 G = 
-tru
+fals
 e;%0A%09

comment out print statements