Commits

chadamas77  committed bae1ea0

first commit

  • Participants

Comments (0)

Files changed (52)

File Li3-C/.classpath

+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>

File Li3-C/.project

+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>Li3-C</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

File Li3-C/.settings/org.eclipse.jdt.core.prefs

+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6

File Li3-C/bin/main/LCArg.class

Binary file added.

File Li3-C/bin/main/LCBlock.class

Binary file added.

File Li3-C/bin/main/LCBreak.class

Binary file added.

File Li3-C/bin/main/LCButton.class

Binary file added.

File Li3-C/bin/main/LCCall.class

Binary file added.

File Li3-C/bin/main/LCChoicePup.class

Binary file added.

File Li3-C/bin/main/LCComp.class

Binary file added.

File Li3-C/bin/main/LCCompiler.class

Binary file added.

File Li3-C/bin/main/LCCondition.class

Binary file added.

File Li3-C/bin/main/LCConfig.class

Binary file added.

File Li3-C/bin/main/LCFunction.class

Binary file added.

File Li3-C/bin/main/LCIncludes.class

Binary file added.

File Li3-C/bin/main/LCLoop.class

Binary file added.

File Li3-C/bin/main/LCMain$1.class

Binary file added.

File Li3-C/bin/main/LCMain.class

Binary file added.

File Li3-C/bin/main/LCMultiCondition.class

Binary file added.

File Li3-C/bin/main/LCNode.class

Binary file added.

File Li3-C/bin/main/LCProgram.class

Binary file added.

File Li3-C/bin/main/LCRend.class

Binary file added.

File Li3-C/bin/main/LCReturn.class

Binary file added.

File Li3-C/bin/main/LCSetter.class

Binary file added.

File Li3-C/bin/main/LCStruct.class

Binary file added.

File Li3-C/bin/main/LCTextBox.class

Binary file added.

File Li3-C/bin/main/LCVar.class

Binary file added.

File Li3-C/bin/main/LCWindow.class

Binary file added.

File Li3-C/src/main/LCArg.java

+package main;
+
+import java.awt.Graphics2D;
+import java.io.Serializable;
+import java.util.ArrayList;
+
+public class LCArg implements LCNode, Serializable {
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = -8598869707130221375L;
+	LCWindow window;
+	LCNode parent;
+	ArrayList<LCTextBox> tbs;
+	boolean byref;
+	LCButton rbtn;
+	
+	String type, vars;
+	
+	@Override
+	public void init(LCNode parent) {
+		this.parent = parent;
+		type = "(type)";
+		vars = "(variable)";
+		byref = false;
+	}
+
+	@Override
+	public LCNode[] getChildren() {
+		return null;
+	}
+
+	@Override
+	public LCNode getParent() {
+		return parent;
+	}
+
+	@Override
+	public String genCode(int language, int indent) {
+		String ref = " ";
+		if (byref)
+			ref = " & ";
+		return LCCompiler.indent(indent) + type + ref + vars;
+	}
+
+	@Override
+	public String getPrototype(int language, int indent) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public void draw(Graphics2D g, LCWindow window) {
+		setWindow(window);
+		if (tbs == null)
+		{
+			tbs = new ArrayList<LCTextBox>();
+			LCTextBox ntb = new LCTextBox();
+			ntb.setText(this.type);
+			ntb.setAlign(LCTextBox.ALIGN_RIGHT);
+			tbs.add(ntb);
+			ntb = new LCTextBox();
+			ntb.setText(this.vars);
+			tbs.add(ntb);
+		}
+		if (rbtn == null)
+		{
+			rbtn = new LCButton();
+			rbtn.setText("");
+		}
+		double w = getWidth()-LCRend.nodeBfr*4.0, h = getHeight();
+		rbtn.setB(0.0, 0.0, 15.0, h);
+		tbs.get(0).setB(0.0+15.0,   0.0, w/4.0-25.0+15.0, h);
+		tbs.get(1).setB(w/4.0+15.0, 0.0, w,          h);
+		LCRend.drawVArrow(g, 7.5, 2.5, h - 2.5, 4.0, LCRend.execArrowClr, window);
+		if (byref)
+			LCRend.drawVArrow(g, 7.5, h - 2.5, 2.5, 4.0, LCRend.execArrowClr, window);
+		LCTextBox.drawAll(g, tbs, window);
+		LCRend.drawHArrow(g, w/4.0-22.5+15.0, w/4.0-2.5+15.0, 0.5*h, 5.0, LCRend.declArrowClr, window);
+	}
+
+	@Override
+	public double getWidth() {
+		return (LCRend.nodeWidth + LCRend.nodeBfr*2.0) * LCRend.subFactor;
+	}
+
+	@Override
+	public double getHeight() {
+		return LCRend.fontSize + 5.0;
+	}
+
+	@Override
+	public String setParam(int param, Object data) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public Object getParam(int param) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public boolean handleClick(double mx, double my, int button, LCWindow window) {
+		if (LCTextBox.handleClickAll(mx, my, button, tbs, window))
+		{
+			type = tbs.get(0).text;
+			vars = tbs.get(1).text;
+			return true;
+		}
+		if (rbtn.handleClick(mx, my, button, window))
+			byref = !byref;
+		return false;
+	}
+
+	@Override
+	public void move(LCNode newParent) {
+		// TODO Auto-generated method stub
+
+	}
+
+	@Override
+	public void releaseChild(LCNode child) {
+		// TODO Auto-generated method stub
+
+	}
+
+	@Override
+	public void setWindow(LCWindow window) {
+		this.window = window;
+	}
+
+	@Override
+	public LCWindow getWindow() {
+		return this.window;
+	}
+
+	@Override
+	public String getName() {
+		return "var";
+	}
+}

File Li3-C/src/main/LCBlock.java

+package main;
+
+import java.awt.Color;
+import java.awt.Graphics2D;
+import java.io.Serializable;
+import java.util.ArrayList;
+
+public class LCBlock implements LCNode, Serializable {
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = -5279850833154003119L;
+	ArrayList<LCNode> statements = null;
+	LCWindow window = null;
+	LCNode parent = null;
+	ArrayList<LCButton> btns = null, dbtns = null;
+	
+	public static LCChoicePup chc = null;
+	public static int inscur;
+	public static final String[] bfchc = { "Variable Decl.", "Setter", "Condition", "Multi-Condition", "Font Loop", "Routine Call", "Loop Break", "Function Return" };
+	public static ArrayList<LCNode> insst = null;
+	public static LCNode insp = null;
+	public static LCWindow chcwind = null;
+	
+	@Override
+	public void init(LCNode parent) {
+		this.parent = parent;
+		this.statements = new ArrayList<LCNode>();
+	}
+
+	@Override
+	public LCNode[] getChildren() {
+		LCNode [] ret = new LCNode[statements.size()];
+		for (int i=0; i<statements.size(); i++)
+			ret[i] = statements.get(i);
+		return ret;
+	}
+
+	@Override
+	public LCNode getParent() {
+		return parent;
+	}
+
+	@Override
+	public String genCode(int language, int indent) {
+		String code = "";
+		code += LCCompiler.indent(indent) + "{\n";
+		for (int i=0; i<statements.size(); i++)
+			code += statements.get(i).genCode(language, indent+1) + "\n";
+		code += LCCompiler.indent(indent) + "}\n";
+		return code;
+	}
+
+	@Override
+	public String getPrototype(int language, int indent) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public void draw(Graphics2D g, LCWindow window) {
+		this.setWindow(window);
+		
+		double w = getWidth();
+		double h = getHeight();
+		
+		Color clr = LCRend.fgc;
+		if (LCComp.hled == this) clr = LCRend.hlbClr;
+		LCRend.drawNodeBoxHl(g, clr, new Color(0.5f, 0.5f, 0.7f, 0.5f), 0, 0.0, w, h, LCRend.nodeBfr, window);
+	
+		if (btns == null) btns = new ArrayList<LCButton>();
+		if (dbtns == null) dbtns = new ArrayList<LCButton>();
+		btns.clear();
+		dbtns.clear();
+		
+		double y = LCRend.nodeBfr * 1.5;
+		
+		LCButton insAft = new LCButton(), del = null;
+		insAft.setText("Insert");
+		insAft.setB(LCRend.nodeBfr, y - LCRend.nodeBfr * 1.5 + 0.5, LCRend.nodeBfr + 25.0, y - 0.5);
+		insAft.setAlign(LCButton.ALIGN_CENTER);
+		btns.add(insAft);
+		
+		LCRend.drawVArrow(g, w / 2.0, y - LCRend.nodeBfr * 1.5 + 1.0, y - 1.0, 2.5, LCRend.execArrowClr, window);
+		
+		for (int i=0; i<statements.size(); i++)
+		{
+			double h2 = statements.get(i).getHeight() / LCRend.subFactor;
+			statements.get(i).draw(g, window.subWindow(LCRend.nodeBfr, y));
+			
+			if (statements.get(i).getName().compareTo("break") != 0)
+			{
+				LCRend.drawVArrow(g, w / 2.0, y + h2 + 1.0, y + h2 + LCRend.nodeBfr * 1.5 - 1.0, 2.5, LCRend.execArrowClr, window);
+				
+				insAft = new LCButton();
+				insAft.setText("Insert");
+				insAft.setB(LCRend.nodeBfr, y + h2 + 0.5, LCRend.nodeBfr + 25.0, y + h2 + LCRend.nodeBfr * 1.5  - 0.5);
+				insAft.setAlign(LCButton.ALIGN_CENTER);
+				btns.add(insAft);
+			}
+			
+			double w2 = w - LCRend.nodeBfr;
+			del = new LCButton();
+			del.setText("X");
+			del.setB(w2-5.0, y, w2, y+5.0);
+			del.setAlign(LCButton.ALIGN_CENTER);
+			del.setColor(LCRend.delBClr);
+			dbtns.add(del);
+			
+			y += h2 + LCRend.nodeBfr * 1.5;
+		}
+		
+		LCButton.drawAll(g, btns, window);
+		LCButton.drawAll(g, dbtns, window);
+	}
+
+	@Override
+	public double getWidth() {
+		return LCRend.nodeWidth + LCRend.nodeBfr * 2.0;
+	}
+
+	@Override
+	public double getHeight() {
+		double height = 0.0;
+		for (int i=0; i<statements.size(); i++)
+			height += statements.get(i).getHeight();
+		height /= LCRend.subFactor;
+		height += LCRend.nodeBfr * 1.5 * (double)(statements.size()-1);
+		if (height < 0.001) height += LCRend.nodeBfr * 0.5;
+		return height + LCRend.nodeBfr * 3.0;
+	}
+
+	@Override
+	public String setParam(int param, Object data) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public Object getParam(int param) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public boolean handleClick(double mx, double my, int button, LCWindow window) {
+		if (LCRend.pointInTb(mx, my, 0.0, 0.0, getWidth(), getHeight(), getWindow()))
+		{
+			LCComp.hled = this;
+			int c = LCButton.handleClickAll(mx, my, button, dbtns, this.window);
+			if (c >= 0)
+			{
+				statements.remove(c);
+				return true;
+			}
+			c = LCButton.handleClickAll(mx, my, button, btns, this.window);
+			if (c >= 0)
+			{
+				LCBlock.inscur = c;
+				LCBlock.insst = statements;
+				LCBlock.insp = this;
+				int off = 1;
+				if (c == 0 || this.statements.get(c-1).getName().compareTo("var") == 0)
+					off = 0;
+				if (c >= 0 && c < this.statements.size() && this.statements.get(c).getName().compareTo("var") == 0)
+					off = ~1;
+				if (!(LCBreak.canPut(this) && c == this.statements.size()))
+					off = off | Integer.parseInt("1000000", 2);
+				LCBlock.chc = new LCChoicePup(btns.get(c).x1, btns.get(c).y2, (LCRend.fontSize+5.0) * 15.0, (LCRend.fontSize+5.0), LCBlock.bfchc, off, getWindow());
+				return true;
+			}
+			for (int i=0; i<statements.size(); i++)
+				if (statements.get(i).handleClick(mx, my, button, statements.get(i).getWindow()))
+					return true;
+			return true;
+		}
+		return false;
+	}
+
+	static void doInsert(LCNode p, ArrayList<LCNode> stm, int pos, int c)
+	{
+		LCNode nn;
+		if (c == 0)
+			nn = new LCVar();
+		else if (c == 1)
+			nn = new LCSetter();
+		else if (c == 2)
+			nn = new LCCondition();
+		else if (c == 3)
+			nn = new LCMultiCondition();
+		else if (c == 4)
+			nn = new LCLoop();
+		else if (c == 5)
+			nn = new LCCall();
+		else if (c == 6)
+			nn = new LCBreak();
+		else if (c == 7)
+			nn = new LCReturn();
+		else if (c == 99)
+			nn = new LCArg();
+		else
+			nn = null;
+		if (nn != null)
+		{
+			nn.init(p);
+			if (pos == stm.size())
+				stm.add(nn);
+			else
+				stm.add(pos, nn);
+		}
+	}
+
+	@Override
+	public void move(LCNode newParent) {
+		// TODO Auto-generated method stub
+
+	}
+
+	@Override
+	public void releaseChild(LCNode child) {
+		// TODO Auto-generated method stub
+
+	}
+
+	@Override
+	public void setWindow(LCWindow window) {
+		this.window = window;
+	}
+
+	@Override
+	public LCWindow getWindow() {
+		return this.window;
+	}
+
+	@Override
+	public String getName() {
+		return "block";
+	}
+
+}

File Li3-C/src/main/LCBreak.java

+package main;
+
+import java.awt.Color;
+import java.awt.Graphics2D;
+import java.io.Serializable;
+
+public class LCBreak implements LCNode, Serializable {
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = -5335604176943339766L;
+	LCWindow window;
+	LCNode parent;
+	
+	@Override
+	public void init(LCNode parent) {
+		this.parent = parent;
+	}
+
+	@Override
+	public LCNode[] getChildren() {
+		return null;
+	}
+
+	@Override
+	public LCNode getParent() {
+		return parent;
+	}
+
+	@Override
+	public String genCode(int language, int indent) {
+		return LCCompiler.indent(indent) + "break;";
+	}
+
+	@Override
+	public String getPrototype(int language, int indent) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public void draw(Graphics2D g, LCWindow window) {
+		setWindow(window);
+		double w = getWidth()-LCRend.nodeBfr*4.0, h = getHeight();
+		LCRend.drawEllipse(g, LCRend.execArrowClr, LCRend.nodeBfr * 2.5, 1.0, LCRend.nodeBfr * 2.5 + h - 2.0, h - 1.0, window);
+		LCRend.drawHArrow(g, 22.5, 2.5, 0.5*h, 5.0, Color.red, window);
+		//LCRend.drawHArrow(g, 22.5, 2.5+5.0, 0.5*h, 5.0, LCRend.execArrowClr, window);
+	}
+
+	@Override
+	public double getWidth() {
+		return (LCRend.nodeWidth + LCRend.nodeBfr*2.0) * LCRend.subFactor;
+	}
+
+	@Override
+	public double getHeight() {
+		return (LCRend.fontSize + 5.0);
+	}
+
+	@Override
+	public String setParam(int param, Object data) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public Object getParam(int param) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public boolean handleClick(double mx, double my, int button, LCWindow window) {
+		return false;
+	}
+
+	@Override
+	public void move(LCNode newParent) {
+		// TODO Auto-generated method stub
+
+	}
+
+	@Override
+	public void releaseChild(LCNode child) {
+		// TODO Auto-generated method stub
+
+	}
+
+	@Override
+	public void setWindow(LCWindow window) {
+		this.window = window;
+	}
+
+	@Override
+	public LCWindow getWindow() {
+		return this.window;
+	}
+
+	@Override
+	public String getName() {
+		return "break";
+	}
+	
+	public static boolean canPut ( LCNode in )
+	{
+		while (in != null)
+		{
+			if (in.getName().compareTo("loop") == 0)
+				return true;
+			in = in.getParent();
+		}
+		return false;
+	}
+}
+

File Li3-C/src/main/LCButton.java

+package main;
+
+import java.awt.Color;
+import java.awt.Graphics2D;
+import java.io.Serializable;
+import java.util.ArrayList;
+
+public class LCButton implements Serializable {
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 2797038599165939800L;
+
+	public static final int ALIGN_LEFT = 0, ALIGN_RIGHT = 1, ALIGN_CENTER = 2;
+	
+	public double x1, y1, x2, y2;
+	public LCWindow window;
+	public String text;
+	public boolean mouseOver, visible, enabled;
+	public int align;
+	public Color clr;
+	
+	public LCButton( )
+	{
+		text = "";
+		mouseOver = false;
+		visible = false;
+		enabled = true;
+		align = ALIGN_LEFT;
+		clr = LCRend.btnClr;
+	}
+	
+	public static void drawAll(Graphics2D g, ArrayList<LCButton> tbs, LCWindow window)
+	{
+		if (tbs != null)
+		{
+			for (int i=0; i<tbs.size(); i++)
+				tbs.get(i).draw(g, window);
+		}
+	}
+	
+	public static int handleClickAll(double mx, double my, int button, ArrayList<LCButton> tbs, LCWindow window)
+	{
+		if (tbs != null)
+		{
+			for (int i=0; i<tbs.size(); i++)
+				if (tbs.get(i).handleClick(mx, my, button, window))
+					return i;
+		}
+		return -1;
+	}
+	
+	public void setB( double x1, double y1, double x2, double y2 )
+	{
+		this.x1 = x1;
+		this.y1 = y1;
+		this.x2 = x2;
+		this.y2 = y2;
+		this.visible = true;
+	}
+	
+	public void setText( String text )
+	{
+		this.text = text;
+	}
+	
+	public void setAlign (int align)
+	{
+		this.align = align;
+	}
+	
+	public void setVisible( boolean visible )
+	{
+		this.visible = visible;
+	}
+	
+	public void setEnabled( boolean enabled )
+	{
+		this.enabled = enabled;
+	}
+	
+	public void draw(Graphics2D g, LCWindow window)
+	{
+		Color backc = null;
+		if (mouseOver)
+			backc = new Color(clr.getRed(), clr.getGreen(), clr.getBlue(), 255);
+		else
+			backc = clr;
+		LCRend.drawString(g, text, x1, y1, x2, y2, window, backc, align);
+	}
+	
+	public boolean mouseOver(double mx, double my)
+	{
+		if (LCRend.pointInTb(mx, my, x1, y1, x2, y2, window))
+			mouseOver = true;
+		else
+			mouseOver = false;
+		return mouseOver;
+	}
+	
+	public boolean handleClick(double mx, double my, int button, LCWindow window)
+	{
+		if (button == 1 && LCRend.pointInTb(mx, my, x1, y1, x2, y2, window))
+			return true;
+		return false;
+	}
+
+	public void setColor(Color clr)
+	{
+		this.clr = clr;
+	}
+}

File Li3-C/src/main/LCCall.java

+package main;
+
+import java.awt.Graphics2D;
+import java.io.Serializable;
+import java.util.ArrayList;
+
+public class LCCall implements LCNode, Serializable {
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = -8882182685437015801L;
+	LCWindow window;
+	LCNode parent;
+	ArrayList<LCTextBox> tbs;
+	
+	String name, para;
+	
+	@Override
+	public void init(LCNode parent) {
+		this.parent = parent;
+		name = "(name)";
+		para = "(parameters)";
+	}
+
+	@Override
+	public LCNode[] getChildren() {
+		return null;
+	}
+
+	@Override
+	public LCNode getParent() {
+		return parent;
+	}
+
+	@Override
+	public String genCode(int language, int indent) {
+		return LCCompiler.indent(indent) + name + " (" + para + ");";
+	}
+
+	@Override
+	public String getPrototype(int language, int indent) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public void draw(Graphics2D g, LCWindow window) {
+		setWindow(window);
+		if (tbs == null)
+		{
+			tbs = new ArrayList<LCTextBox>();
+			LCTextBox ntb = new LCTextBox();
+			ntb.setText(this.name);
+			ntb.setAlign(LCTextBox.ALIGN_RIGHT);
+			tbs.add(ntb);
+			ntb = new LCTextBox();
+			ntb.setText(this.para);
+			tbs.add(ntb);
+		}
+		double w = getWidth()-LCRend.nodeBfr*4.0, h = getHeight();
+		tbs.get(0).setB(25.0,     0.0, w/4.0, h);
+		tbs.get(1).setB(w/4.0+15, 0.0, w-25,  h);
+		LCRend.drawString(g, "(", w/4.0+1.0, 0.0, w/4.0+14.0, h, window, null, LCTextBox.ALIGN_CENTER);
+		LCRend.drawString(g, ")", w-25+1.0, 0.0, w-25+14.0, h, window, null, LCTextBox.ALIGN_CENTER);
+		LCTextBox.drawAll(g, tbs, window);
+		LCRend.drawHArrow(g, 2.5, 22.5, 0.5*h, 5.0, LCRend.execArrowClr, window);
+	}
+
+	@Override
+	public double getWidth() {
+		return (LCRend.nodeWidth + LCRend.nodeBfr*2.0) * LCRend.subFactor;
+	}
+
+	@Override
+	public double getHeight() {
+		return LCRend.fontSize + 5.0;
+	}
+
+	@Override
+	public String setParam(int param, Object data) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public Object getParam(int param) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public boolean handleClick(double mx, double my, int button, LCWindow window) {
+		if (LCTextBox.handleClickAll(mx, my, button, tbs, window))
+		{
+			this.name = this.tbs.get(0).text;
+			this.para = this.tbs.get(1).text;
+			return true;
+		}
+		return false;
+	}
+
+	@Override
+	public void move(LCNode newParent) {
+		// TODO Auto-generated method stub
+
+	}
+
+	@Override
+	public void releaseChild(LCNode child) {
+		// TODO Auto-generated method stub
+
+	}
+
+	@Override
+	public void setWindow(LCWindow window) {
+		this.window = window;
+	}
+
+	@Override
+	public LCWindow getWindow() {
+		return this.window;
+	}
+
+	@Override
+	public String getName() {
+		return "call";
+	}
+}

File Li3-C/src/main/LCChoicePup.java

+package main;
+
+import java.awt.Color;
+import java.awt.Graphics2D;
+import java.util.ArrayList;
+
+public class LCChoicePup {
+
+	double x, y, w1, fh1, w, h, fh;
+	int ix, iy;
+	int off;
+	String [] choices = null;
+	ArrayList<LCButton> tbs = null;
+	LCWindow window;
+	
+	public LCChoicePup(double x, double y, double w, double fh, String [] choices, int off, LCWindow window)
+	{
+		this.w1 = w; this.fh1 = fh;
+		this.x = x; this.y = y;
+		this.window = window;
+		this.choices = choices;
+		this.off = off;
+		tbs = new ArrayList<LCButton>();
+
+		for (int i=0; i<choices.length; i++)
+		{
+			LCButton tb = new LCButton();
+			if ((off & (1<<i)) != 0)
+				tb.setText("");
+			else
+				tb.setText(choices[i]);
+			tb.setAlign(LCTextBox.ALIGN_CENTER);
+			tbs.add(tb);
+		}
+	}
+	
+	public void draw (Graphics2D g)
+	{
+		double m = LCRend.viewScale * window.scale;
+		w = w1 * m;
+		fh = fh1 * m;
+		h = fh * 1.1 * (double)this.choices.length + 2.0 * LCRend.nodeBfr * m;
+		LCWindow wind = window.transWindow(0.0, 0.0);
+		
+		LCRend.drawNodeBox(g, LCRend.pupClr, x, y, x+w, y+h, LCRend.nodeBfr * m, wind);
+		double y1 = y + LCRend.nodeBfr * m;
+		for (int i=0; i<choices.length; i++)
+		{
+			tbs.get(i).setB(x + LCRend.nodeBfr*m, y1, x+ w-LCRend.nodeBfr*m, y1+fh);
+			y1 += fh*1.1;
+		}
+		LCButton.drawAll(g, tbs, wind);
+		y1 = y + LCRend.nodeBfr * m;
+		for (int i=0; i<choices.length; i++)
+		{
+			if ((off & (1<<i)) != 0)
+				LCRend.drawString(g, choices[i], x + LCRend.nodeBfr*m, y1, x+ w-LCRend.nodeBfr*m, y1+fh, wind, Color.LIGHT_GRAY, LCTextBox.ALIGN_CENTER);
+			y1 += fh*1.1;
+		}
+	}
+	
+	public int handleClick (double mx, double my, int button)
+	{
+		LCWindow wind = window.transWindow(0.0, 0.0);
+		int c = LCButton.handleClickAll(mx, my, button, tbs, wind);
+		if (c >= 0 && (off & (1<<c)) != 0)
+			c = -2;
+		if (c == -1 && LCRend.pointInTb(mx, my, x, y, x+w, y+h, wind))
+			return -2;
+		else
+			return c;
+	}
+}

File Li3-C/src/main/LCComp.java

+package main;
+
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.RenderingHints;
+import java.awt.event.KeyEvent;
+import java.awt.event.KeyListener;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
+import java.awt.event.MouseMotionListener;
+import java.awt.event.MouseWheelEvent;
+import java.awt.event.MouseWheelListener;
+import java.awt.image.BufferedImage;
+
+import javax.swing.JComponent;
+import javax.swing.JFileChooser;
+
+public class LCComp extends JComponent implements MouseMotionListener, MouseListener, MouseWheelListener, KeyListener {
+	
+	private static final long serialVersionUID = -8809276154807875059L;
+	
+	private BufferedImage backBfr = null;
+	private LCProgram prog = null;
+	private double lmx, lmy;
+	public static LCComp rinst = null;
+	public static LCNode hled = null;
+	
+	public LCComp ()
+	{
+		super();
+		this.addMouseListener(this);
+		this.addMouseMotionListener(this);
+		this.addMouseWheelListener(this);
+		this.addKeyListener(this);
+	}
+	
+	public void setProgram ( LCProgram prog )
+	{
+		this.prog = prog;
+	}
+	
+	public void paint ( Graphics g1 )
+	{
+		LCRend.vpWidth = getWidth();
+		LCRend.vpHeight = getHeight();
+		
+		if (backBfr == null)
+			backBfr = (BufferedImage)this.createImage(2000, 2000);
+		
+		Graphics2D g2 = (Graphics2D)g1;
+		Graphics2D g = (Graphics2D)backBfr.getGraphics();
+		g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
+		g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
+		g.setColor(LCRend.bgc);
+		g.fillRect(0, 0, getWidth(), getHeight());
+		
+		if (this.prog != null)
+		{
+			LCWindow window = LCWindow.base;
+			this.prog.draw(g, window);
+		}
+		
+		if (LCBlock.chc != null) LCBlock.chc.draw(g);
+
+		g2.drawImage(backBfr, 0, 0, this);
+	}
+
+	@Override
+	public void mouseClicked(MouseEvent arg0) {
+		LCWindow window = LCWindow.base;
+		double mx = LCRend.unprojectX(arg0.getX(), window);
+		double my = LCRend.unprojectY(arg0.getY(), window);
+		int button = 0;
+		if (arg0.getButton() == MouseEvent.BUTTON1)
+			button = 1;
+		else if (arg0.getButton() == MouseEvent.BUTTON2)
+			button = 2;
+		if (button > 0)
+		{
+			int c = -1;
+			if (LCBlock.chc != null)
+			{
+				c = LCBlock.chc.handleClick(mx, my, button);
+				if (c == -1)
+				{
+					LCBlock.chc = null;
+					repaint();
+				}
+				else if (c >= 0)
+				{
+					LCBlock.doInsert(LCBlock.insp, LCBlock.insst, LCBlock.inscur, c);
+					LCBlock.chc = null;
+					repaint();
+				}
+				else if (c == -2)
+					repaint();
+			}
+			rinst = this;
+			if (c == -1)
+			{
+				if (this.prog.handleClick(mx, my, button, window))
+					repaint();
+				else
+				{
+					LCComp.hled = null;
+					repaint();
+				}
+			}
+		}
+	}
+
+	@Override
+	public void mouseEntered(MouseEvent arg0) {
+		// TODO Auto-generated method stub
+		
+	}
+
+	@Override
+	public void mouseExited(MouseEvent arg0) {
+		// TODO Auto-generated method stub
+		
+	}
+
+	@Override
+	public void mousePressed(MouseEvent arg0) {
+		lmx = LCRend.unprojectX(arg0.getX(), LCWindow.base);
+		lmy = LCRend.unprojectY(arg0.getY(), LCWindow.base);
+	}
+
+	@Override
+	public void mouseReleased(MouseEvent arg0) {
+	}
+
+	@Override
+	public void mouseDragged(MouseEvent arg0) {
+		double mx = LCRend.unprojectX(arg0.getX(), LCWindow.base);	
+		double my = LCRend.unprojectY(arg0.getY(), LCWindow.base);
+		LCRend.viewX += (lmx - mx);
+		LCRend.viewY += (lmy - my);
+		repaint();
+	}
+
+	@Override
+	public void mouseMoved(MouseEvent arg0) {
+		// TODO Auto-generated method stub
+		
+	}
+
+	@Override
+	public void mouseWheelMoved(MouseWheelEvent arg0) {
+		int wv = arg0.getWheelRotation();
+		LCWindow tw = LCWindow.base;
+		double mx = LCRend.unprojectX(arg0.getX(), tw);	
+		double my = LCRend.unprojectY(arg0.getY(), tw);
+		LCRend.viewScale *= Math.pow(1.5, (double)wv);
+		LCRend.viewX = -(arg0.getX()*LCRend.viewScale - mx);
+		LCRend.viewY = -(arg0.getY()*LCRend.viewScale - my);
+		repaint();
+	}
+
+	@Override
+	public void keyPressed(KeyEvent arg0) {
+		// TODO Auto-generated method stub
+		
+	}
+
+	@Override
+	public void keyReleased(KeyEvent arg0) {
+		// TODO Auto-generated method stub
+		
+	}
+
+	@Override
+	public void keyTyped(KeyEvent arg0) {
+		if (arg0.getKeyChar() == 'c')
+		{
+			LCCompiler.compile(prog, false);
+		}
+		else if (arg0.getKeyChar() == 'r')
+		{
+			LCCompiler.compile(prog, true);
+		}
+		else if (arg0.getKeyChar() == 's')
+		{
+			JFileChooser chooser = new JFileChooser();
+			int returnVal = chooser.showSaveDialog(this.getParent());
+			if (returnVal == JFileChooser.APPROVE_OPTION)
+				prog.save(chooser.getSelectedFile());
+		}
+		else if (arg0.getKeyChar() == 'l')
+		{
+		    JFileChooser chooser = new JFileChooser();
+		    int returnVal = chooser.showOpenDialog(this.getParent());
+		    if(returnVal == JFileChooser.APPROVE_OPTION)
+		    {
+		    	LCProgram np = LCProgram.load(chooser.getSelectedFile());
+		    	if (np != null)
+		    		setProgram(np);
+		    }
+		    repaint();
+		}
+	}
+
+}

File Li3-C/src/main/LCCompiler.java

+package main;
+
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.InputStreamReader;
+
+import javax.swing.JOptionPane;
+
+public class LCCompiler {
+
+	public static final int CLCPP = 0;
+	public static final int FB	  = 1;
+	
+	public static String indent ( int indent )
+	{
+		String s = "";
+		for (int i=0; i<indent*4; i++)
+			s += " ";
+		return s;
+	}
+	
+	public static void compile (LCProgram prog, boolean runFlag)
+	{
+		String code = prog.genCode(LCCompiler.CLCPP, 0);
+		try {
+			BufferedWriter out = new BufferedWriter(new FileWriter("/tmp/a.cpp"));
+			out.write(code);
+			out.close();
+			out = new BufferedWriter(new FileWriter("/tmp/exec.sh"));
+			out.write("@a.out\n\rpause\n\rexit");
+			out.close();
+		} catch (IOException e1) {
+			e1.printStackTrace();
+		}
+		Runtime run = Runtime.getRuntime();
+		String [] cmd = { "g++", "/tmp/a.cpp", "-o", "/tmp/a.out" };
+		Process pr;
+		try {
+			pr = run.exec(cmd, null, new File("/tmp"));
+			try {
+				pr.waitFor();
+			} catch (InterruptedException e) {
+				e.printStackTrace();
+			}
+			String msg = "";
+			BufferedReader buf = new BufferedReader( new InputStreamReader( pr.getErrorStream() ) ) ;
+			String line;
+			while ( ( line = buf.readLine() ) != null )
+			{
+				msg += line + "\n";
+			}
+			if (pr.exitValue() == 0)
+				msg += "Success";
+			
+			if (pr.exitValue() != 0 || runFlag == false)
+				JOptionPane.showMessageDialog(null, msg);
+						
+			if (runFlag && pr.exitValue() == 0)
+			{
+				String cmd2[] = { "/usr/bin/open", "Terminal", "/tmp/a.out" };
+				pr = run.exec(cmd2, null, new File("/home"));
+				try {
+					pr.waitFor();
+				} catch (InterruptedException e) {
+					e.printStackTrace();
+				}
+			}
+		} catch (IOException e) {
+			e.printStackTrace();
+		}
+	}
+	
+}

File Li3-C/src/main/LCCondition.java

+package main;
+
+import java.awt.Color;
+import java.awt.Graphics2D;
+import java.io.Serializable;
+import java.util.ArrayList;
+
+public class LCCondition implements LCNode, Serializable {
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = -806842181219789819L;
+	LCWindow window;
+	LCNode parent;
+	String cond;
+	LCNode yesblock, noblock;
+	ArrayList<LCTextBox> tbs;
+	
+	@Override
+	public void init(LCNode parent) {
+		this.parent = parent;
+		yesblock = new LCBlock();
+		yesblock.init(this);
+		noblock = new LCBlock();
+		noblock.init(this);
+		tbs = null;
+		cond = "(condition)";
+	}
+
+	@Override
+	public LCNode[] getChildren() {
+		LCNode [] ret = new LCNode[2];
+		ret[0] = yesblock;
+		ret[1] = noblock;
+		return ret;
+	}
+
+	@Override
+	public LCNode getParent() {
+		return parent;
+	}
+
+	@Override
+	public String genCode(int language, int indent) {
+		String code = LCCompiler.indent(indent) + "if (" + cond + ")\n";
+		code += yesblock.genCode(language, indent);
+		code += LCCompiler.indent(indent) + "else\n";
+		code += noblock.genCode(language, indent);
+		return code;
+	}
+
+	@Override
+	public String getPrototype(int language, int indent) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public void draw(Graphics2D g, LCWindow window) {
+		setWindow(window);
+		
+		double w = getWidth(), h = getHeight();
+		
+		if (tbs == null)
+		{
+			tbs = new ArrayList<LCTextBox>();
+			LCTextBox ntb = new LCTextBox();
+			ntb.setText(this.cond);
+			ntb.setAlign(LCTextBox.ALIGN_CENTER);
+			tbs.add(ntb);
+		}
+		tbs.get(0).setB(0.0, 0.0, w - LCRend.nodeBfr * 2.0, LCRend.fontSize + 5.0);
+		
+		LCTextBox.drawAll(g, tbs, window);
+		
+		double hw = (w - LCRend.nodeBfr * 2.0) / 2.0;
+		double qx = (w - LCRend.nodeBfr * 2.0) / 2.0 - 10.0;
+		double qy = LCRend.fontSize + 5.0 + 35.0 / 2.0 - 12.5;
+		int yy = LCRend.projectY(qy + 12.5, window);
+		int x1x = LCRend.projectX(qx + 10.0 - 35.0 / 2.0, window);
+		int x2x = LCRend.projectX(qx + 10.0 + 35.0 / 2.0, window);
+		int xx1 = LCRend.projectX(hw/2.0, window);
+		int xx2 = LCRend.projectX(hw+hw/2.0, window);
+		int xc = LCRend.projectX(w/2.0-LCRend.nodeBfr, window);
+		int yh = LCRend.projectY(h, window);
+		int yh2 = LCRend.projectY(h+LCRend.nodeBfr, window);
+		
+		LCRend.drawString(g, "?", qx, qy + 12.5/4.0, qx+20.0, qy+20.0+12.5/4.0, window, null, LCTextBox.ALIGN_CENTER);
+		
+		g.setColor(new Color(0.0f, 0.8f, 0.0f));
+		g.drawLine(x2x, yy, xx2, yy);
+		g.drawLine(xx2, yy, xx2, yh);
+		g.drawLine(xx2, yh, xc, yh);
+		g.setColor(LCRend.execArrowClr);
+		g.drawLine(xc, yh, xc, yh2);
+		LCRend.drawVArrow(g, hw+hw/2.0, qy + 12.5, qy + 12.5 + 35.0/2.0, 6.0, new Color(0.0f, 0.8f, 0.0f), window);
+		
+		g.setColor(Color.red);
+		g.drawLine(x1x, yy, xx1, yy);
+		g.drawLine(xx1, yy, xx1, yh);
+		g.drawLine(xx1, yh, xc, yh);
+		LCRend.drawVArrow(g, hw/2.0, qy + 12.5, qy + 12.5 + 35.0/2.0, 6.0, Color.red, window);
+		
+		LCRend.drawDiamond(g, (w - LCRend.nodeBfr * 2.0) / 2.0, LCRend.fontSize + 5.0 + 35.0 / 2.0, 35.0 / 2.0, window);
+		noblock.draw(g, window.fitWindow(0.5, 35 + LCRend.fontSize + 5.0, hw-1.0));
+		yesblock.draw(g, window.fitWindow(noblock.getWidth() - LCRend.nodeBfr*2.0, 35 + LCRend.fontSize + 5.0, hw-1.0));
+
+	}
+
+	@Override
+	public double getWidth() {
+		return LCRend.nodeWidth * 2.0 + LCRend.nodeBfr * 2.0;
+	}
+
+	@Override
+	public double getHeight() {
+		double f = 1.0 - (LCRend.nodeBfr*2.0/LCRend.nodeWidth);
+		return LCRend.fontSize + 5.0 + 35.0 + Math.max(yesblock.getHeight(), noblock.getHeight())*f + LCRend.nodeBfr / 2.0;
+	}
+
+	@Override
+	public String setParam(int param, Object data) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public Object getParam(int param) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public boolean handleClick(double mx, double my, int button, LCWindow window) {
+		if (LCTextBox.handleClickAll(mx, my, button, tbs, window))
+		{
+			cond = tbs.get(0).text;
+			return true;
+		}
+		if (yesblock.handleClick(mx, my, button, window))
+			return true;
+		if (noblock.handleClick(mx, my, button, window))
+			return true;
+		return false;
+	}
+
+	@Override
+	public void move(LCNode newParent) {
+		// TODO Auto-generated method stub
+
+	}
+
+	@Override
+	public void releaseChild(LCNode child) {
+		// TODO Auto-generated method stub
+
+	}
+
+	@Override
+	public void setWindow(LCWindow window) {
+		this.window = window;
+	}
+
+	@Override
+	public LCWindow getWindow() {
+		return window;
+	}
+
+	@Override
+	public String getName() {
+		return "condition";
+	}
+
+}

File Li3-C/src/main/LCConfig.java

+package main;
+
+public class LCConfig {
+	
+}

File Li3-C/src/main/LCFunction.java

+package main;
+
+import java.awt.Color;
+import java.awt.Graphics2D;
+import java.io.Serializable;
+import java.util.ArrayList;
+
+public class LCFunction implements LCNode, Serializable {
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 1716987224723279329L;
+	public static final int P_NAME 		= 0;
+	public static final int P_RTYPE		= 1;
+	
+	ArrayList<LCNode> statements = null;
+	LCNode parent = null;
+	String name, retType;
+	LCWindow window = null;
+	ArrayList<LCButton> btns = null, dbtns = null, btnsar = null, dbtnsar = null;
+	LCButton argbtn = null;
+	ArrayList<LCTextBox> tbs = null;
+	ArrayList<LCNode> args = null;
+	boolean argsShow;
+	
+	@Override
+	public void init( LCNode parent ) {
+		this.name = "(name)";
+		this.retType = "(type)";
+		this.parent = parent;
+		this.statements = new ArrayList<LCNode>();
+		LCReturn ret = new LCReturn();
+		ret.init(this);
+		this.statements.add(ret);
+		this.args = new ArrayList<LCNode>();
+	}
+
+	@Override
+	public LCNode[] getChildren() {
+		LCNode [] ret = new LCNode[statements.size()];
+		for (int i=0; i<statements.size(); i++)
+			ret[i] = statements.get(i);
+		return ret;
+	}
+
+	@Override
+	public LCNode getParent() {
+		return parent;
+	}
+
+	@Override
+	public String genCode(int language, int indent) {
+		String code = retType + " " + name + " (\n " + getArgStr(language, indent);
+		code += LCCompiler.indent(indent) + ")\n";
+		code += "{\n";
+		for (int i=0; i<statements.size(); i++)
+			code += statements.get(i).genCode(language, indent+1) + "\n";
+		code += "}\n";
+		return code;
+	}
+
+	private String getArgStr(int language, int indent) {
+		String cmd = "";
+		for (int i=0; i<args.size(); i++)
+		{
+			cmd += args.get(i).genCode(language, indent+2);
+			if (i < (args.size()-1))
+				cmd += ",";
+			cmd += "\n";
+		}
+		return cmd;
+	}
+
+	@Override
+	public String getPrototype(int language, int indent) {
+		return retType + " " + name + " (\n " + getArgStr(language, indent) + " );\n ";
+	}
+
+	@Override
+	public void draw(Graphics2D g, LCWindow window) {
+		this.setWindow(window);
+		
+		double w = getWidth();
+		double h = getHeight();
+		
+		Color clr = LCRend.fgc;
+		if (LCComp.hled == this) clr = LCRend.hlbClr;
+
+		if (tbs == null)
+		{
+			tbs = new ArrayList<LCTextBox>();
+			LCTextBox tb;
+			
+			tb = new LCTextBox();
+			tb.setText(name);
+			tbs.add(tb);
+			
+			tb = new LCTextBox();
+			tb.setText(retType);
+			tbs.add(tb);
+		}
+		tbs.get(0).setB(w/4.0, 0, w, LCRend.fontSize + 5.0);
+		tbs.get(1).setB(0.0, 5.0, w/4.0-5.0, LCRend.fontSize + 5.0);
+		//LCRend.drawString(g, name + " (" + retType + ")", LCRend.nodeBfr/2, 0, w-LCRend.nodeBfr/2, LCRend.fontSize + 5.0, window, null, LCTextBox.ALIGN_LEFT);
+		
+		if (btns == null) btns = new ArrayList<LCButton>();
+		if (dbtns == null) dbtns = new ArrayList<LCButton>();
+		if (btnsar == null) btnsar = new ArrayList<LCButton>();
+		if (dbtnsar == null) dbtnsar = new ArrayList<LCButton>();
+
+		if (argbtn == null)
+		{
+			argbtn = new LCButton();
+			argbtn.setText("Args");
+		}
+		
+		argbtn.setB(w-w/5.0, 0.0, w-12.5, LCRend.fontSize);
+		if (argsShow)
+		{
+			LCRend.drawVArrow(g, w-w/15.0, LCRend.fontSize-4.0, 3.0, 3.0, Color.black, window);
+		}
+		
+		btns.clear();
+		dbtns.clear();
+		btnsar.clear();
+		dbtnsar.clear();
+		
+		double y = LCRend.nodeBfr * 2.0 + LCRend.fontSize + 5.0;
+		double y11 = y;
+
+		if (argsShow)
+		{
+			for (int i=0; i<args.size(); i++)
+				y11 += args.get(i).getHeight() / LCRend.subFactor + LCRend.nodeBfr * 1.5;
+			y11 += LCRend.nodeBfr;
+			
+			LCRend.drawNodeBoxHl(g, clr, new Color(0.5f, 0.7f, 0.7f, 0.5f), 0.0, y-LCRend.nodeBfr*2.0, w, y11 + LCRend.nodeBfr, LCRend.nodeBfr, window);
+
+			LCButton insAft = new LCButton();
+			insAft.setText("Insert");
+			insAft.setB(LCRend.nodeBfr, y - LCRend.nodeBfr * 1.5 + 0.5, LCRend.nodeBfr + 25.0, y - 0.5);
+			insAft.setAlign(LCButton.ALIGN_CENTER);
+			btnsar.add(insAft);
+			
+			for (int i=0; i<args.size(); i++)
+			{
+				double h2 = args.get(i).getHeight() / LCRend.subFactor;
+				args.get(i).draw(g, window.subWindow(LCRend.nodeBfr, y));
+				
+				//LCRend.drawVArrow(g, w / 2.0, y + h2 + 1.0, y + h2 + LCRend.nodeBfr * 1.5 - 1.0, 2.5, LCRend.execArrowClr, window);
+				insAft = new LCButton();
+				insAft.setText("Insert");
+				insAft.setB(LCRend.nodeBfr, y + h2 + 0.5, LCRend.nodeBfr + 25.0, y + h2 + LCRend.nodeBfr * 1.5 - 0.5);
+				insAft.setAlign(LCButton.ALIGN_CENTER);
+				btnsar.add(insAft);
+				
+				LCButton del;
+				double w2 = w - LCRend.nodeBfr;
+				del = new LCButton();
+				del.setText("X");
+				del.setB(w2-5.0, y, w2, y+5.0);
+				del.setAlign(LCButton.ALIGN_CENTER);
+				del.setColor(LCRend.delBClr);
+				dbtnsar.add(del);
+				
+				y += h2 + LCRend.nodeBfr * 1.5;
+			}
+	
+			y += LCRend.nodeBfr * 3.5;
+		}
+			
+		LCRend.drawNodeBoxHl(g, clr, new Color(0.5f, 0.7f, 0.5f, 0.5f), 0.0, y-LCRend.nodeBfr*2.0, w, h, LCRend.nodeBfr, window);
+		
+		LCButton insAft = new LCButton(), del = null;
+		insAft.setText("Insert");
+		insAft.setB(LCRend.nodeBfr, y - LCRend.nodeBfr * 1.5 + 0.5, LCRend.nodeBfr + 25.0, y - 0.5);
+		insAft.setAlign(LCButton.ALIGN_CENTER);
+		btns.add(insAft);
+		
+		LCRend.drawVArrow(g, w / 2.0, y - LCRend.nodeBfr * 1.5 + 1.0, y - 1.0, 2.5, LCRend.execArrowClr, window);
+		
+		for (int i=0; i<statements.size(); i++)
+		{
+			double h2 = statements.get(i).getHeight() / LCRend.subFactor;
+			statements.get(i).draw(g, window.subWindow(LCRend.nodeBfr, y));
+			
+			if (i<(statements.size()-1))
+			{
+				LCRend.drawVArrow(g, w / 2.0, y + h2 + 1.0, y + h2 + LCRend.nodeBfr * 1.5 - 1.0, 2.5, LCRend.execArrowClr, window);
+				
+				insAft = new LCButton();
+				insAft.setText("Insert");
+				insAft.setB(LCRend.nodeBfr, y + h2 + 0.5, LCRend.nodeBfr + 25.0, y + h2 + LCRend.nodeBfr * 1.5 - 0.5);
+				insAft.setAlign(LCButton.ALIGN_CENTER);
+				btns.add(insAft);
+
+				double w2 = w - LCRend.nodeBfr;
+				del = new LCButton();
+				del.setText("X");
+				del.setB(w2-5.0, y, w2, y+5.0);
+				del.setAlign(LCButton.ALIGN_CENTER);
+				del.setColor(LCRend.delBClr);
+				dbtns.add(del);
+			}
+			
+			y += h2 + LCRend.nodeBfr * 1.5;
+		}
+		
+		LCButton.drawAll(g, btns, window);
+		LCButton.drawAll(g, dbtns, window);
+		LCButton.drawAll(g, btnsar, window);
+		LCButton.drawAll(g, dbtnsar, window);
+		LCTextBox.drawAll(g, tbs, window);
+		argbtn.draw(g, window);
+	}
+
+	@Override
+	public double getWidth() {
+		return LCRend.nodeWidth + LCRend.nodeBfr * 2.0;
+	}
+
+	@Override
+	public double getHeight() {
+		double height = 0.0;
+		for (int i=0; i<statements.size(); i++)
+			height += statements.get(i).getHeight();
+		height /= LCRend.subFactor;
+		height += LCRend.nodeBfr * 1.5 * (double)(statements.size()-1);
+		double argh = 0.0;
+		for (int i=0; i<args.size(); i++)
+			argh += args.get(i).getHeight() / LCRend.subFactor;
+		if (height < 0.001) height += LCRend.nodeBfr * 0.5;
+		if (argsShow)
+		{
+			height += LCRend.nodeBfr * 3.5 + LCRend.nodeBfr * 1.5 * (double)(Math.max(args.size(),1)-1) + argh;
+			if (args.size() > 0)
+				height += LCRend.nodeBfr * 1.5;
+		}
+		return height + LCRend.nodeBfr * 3.5 + LCRend.fontSize + 5.0;
+	}
+
+	@Override
+	public String setParam(int param, Object data) {
+		switch (param)
+		{
+		case P_NAME:
+			name = (String)data;
+			break;
+		case P_RTYPE:
+			retType = (String)data;
+			break;
+		default:
+			return "Error: LCFunction parameter unkowen";
+		}
+		return null;
+	}
+
+	@Override
+	public Object getParam(int param) {
+		switch (param)
+		{
+		case P_NAME:
+			return name;
+		case P_RTYPE:
+			return retType;
+		}
+		return null;
+	}
+
+	@Override
+	public boolean handleClick(double mx, double my, int button, LCWindow window) {
+		if (LCRend.pointInTb(mx, my, 0.0, 0.0, getWidth(), getHeight(), getWindow()))
+		{
+			if (argbtn.handleClick(mx, my, button, window))
+			{
+				argsShow = !argsShow;
+				return true;
+			}
+			
+			if (LCTextBox.handleClickAll(mx, my, button, tbs, window))
+			{
+				this.name = tbs.get(0).text;
+				this.retType = tbs.get(1).text;
+				return true;
+			}
+			
+			LCComp.hled = this;
+			int c = LCButton.handleClickAll(mx, my, button, dbtns, this.window);
+			if (c >= 0)
+			{
+				statements.remove(c);
+				return true;
+			}
+			c = LCButton.handleClickAll(mx, my, button, dbtnsar, this.window);
+			if (c >= 0)
+			{
+				args.remove(c);
+				return true;
+			}
+			c = LCButton.handleClickAll(mx, my, button, btns, this.window);
+			if (c >= 0)
+			{
+				LCBlock.inscur = c;
+				LCBlock.insst = statements;
+				LCBlock.insp = this;
+				int off = 1;
+				if (c == 0 || this.statements.get(c-1).getName().compareTo("var") == 0)
+					off = 0;
+				if (c >= 0 && c < this.statements.size() && this.statements.get(c).getName().compareTo("var") == 0)
+					off = ~1;
+				off = off | Integer.parseInt("1000000", 2);
+				LCBlock.chc = new LCChoicePup(btns.get(c).x1, btns.get(c).y2, (LCRend.fontSize+5.0) * 15.0, (LCRend.fontSize+5.0), LCBlock.bfchc, off, getWindow());
+				return true;
+			}
+			c = LCButton.handleClickAll(mx, my, button, btnsar, window);
+			if (c >= 0)
+			{
+				LCBlock.doInsert(this, this.args, c, 99);
+				return true;
+			}
+			for (int i=0; i<args.size(); i++)
+				if (args.get(i).handleClick(mx, my, button, args.get(i).getWindow()))
+					return true;
+			for (int i=0; i<statements.size(); i++)
+				if (statements.get(i).handleClick(mx, my, button, statements.get(i).getWindow()))
+					return true;
+			return true;
+		}
+		return false;
+	}
+
+	@Override
+	public void move(LCNode newParent) {
+		// TODO Auto-generated method stub
+		
+	}
+
+	@Override
+	public void releaseChild(LCNode child) {
+		// TODO Auto-generated method stub
+		
+	}
+
+	@Override
+	public void setWindow(LCWindow window) {
+		this.window = window;
+	}
+
+	@Override
+	public LCWindow getWindow() {
+		return this.window;
+	}
+
+	@Override
+	public String getName() {
+		return "function";
+	}
+}

File Li3-C/src/main/LCIncludes.java

+package main;
+
+import java.awt.Color;
+import java.awt.Graphics2D;
+import java.io.Serializable;
+import java.util.ArrayList;
+
+public class LCIncludes implements LCNode, Serializable {
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 9192234800613475136L;
+	LCNode parent = null;
+	ArrayList<String> incFiles = null;
+	ArrayList<LCTextBox> tbs = null;
+	ArrayList<LCButton> insb = null, delb = null;
+	LCWindow window = null;
+	
+	@Override
+	public void init(LCNode parent) {
+		this.parent = parent;
+		incFiles = new ArrayList<String>();
+		incFiles.add("cstdio");
+		incFiles.add("cstdlib");
+		tbs = null;
+		insb = null;
+		delb = null;
+	}
+
+	@Override
+	public LCNode[] getChildren() {
+		return null;
+	}
+
+	@Override
+	public LCNode getParent() {
+		return parent;
+	}
+
+	@Override
+	public String genCode(int language, int indent) {
+		String code = "";
+		for (int i=0; i<incFiles.size(); i++)
+			code += LCCompiler.indent(indent) + "#include <" + incFiles.get(i) + ">\n";
+		return code;			
+	}
+
+	@Override
+	public String getPrototype(int language, int indent) {
+		return "";
+	}
+
+	@Override
+	public void draw(Graphics2D g, LCWindow window) {
+		this.setWindow(window);
+		
+		double w = getWidth();
+		double h = getHeight();
+		LCRend.drawNodeBox(g, new Color(0.7f, 0.7f, 0.3f), 0.0, LCRend.fontSize + 5.0, w, h, LCRend.nodeBfr, window);
+		LCRend.drawString(g, "Includes", LCRend.nodeBfr/2, 0, w-LCRend.nodeBfr/2, LCRend.fontSize + 5.0, window, null, LCTextBox.ALIGN_LEFT);
+		
+		if (insb == null)
+			insb = new ArrayList<LCButton>();
+		
+		if (delb == null)
+			delb = new ArrayList<LCButton>();
+		
+		insb.clear();
+		delb.clear();
+		
+		if (tbs == null)
+		{
+			tbs = new ArrayList<LCTextBox>();
+			for (int i=0; i<incFiles.size(); i++)
+			{
+				LCTextBox ntb = new LCTextBox();
+				ntb.setText(incFiles.get(i));
+				tbs.add(ntb);
+			}
+		}
+		
+		double y = LCRend.fontSize + 5.0 + LCRend.nodeBfr * 1.5;
+		
+		LCButton insAft = new LCButton(), del = null;
+		insAft.setText("Insert");
+		insAft.setB(LCRend.nodeBfr, y - LCRend.nodeBfr * 1.5 + 0.5, LCRend.nodeBfr + 25.0, y - 0.5);
+		insAft.setAlign(LCButton.ALIGN_CENTER);
+		insb.add(insAft);
+		
+		for (int i=0; i<incFiles.size(); i++)
+		{
+			tbs.get(i).setB(LCRend.nodeBfr, y, w - LCRend.nodeBfr, y + LCRend.fontSize/2.0 + 5.0);
+			
+			double w2 = w - LCRend.nodeBfr;
+			del = new LCButton();
+			del.setText("X");
+			del.setB(w2-5.0, y, w2, y+5.0);
+			del.setAlign(LCButton.ALIGN_CENTER);
+			del.setColor(LCRend.delBClr);
+			delb.add(del);
+			
+			y += LCRend.fontSize/2.0 + 5.0 + LCRend.nodeBfr * 1.5;
+			
+			insAft = new LCButton();
+			insAft.setText("Insert");
+			insAft.setB(LCRend.nodeBfr, y - LCRend.nodeBfr * 1.5 + 0.5, LCRend.nodeBfr + 25.0, y - 0.5);
+			insAft.setAlign(LCButton.ALIGN_CENTER);
+			insb.add(insAft);
+		}
+		
+		LCTextBox.drawAll(g, tbs, window);
+		LCButton.drawAll(g, insb, window);
+		LCButton.drawAll(g, delb, window);
+	}
+
+	@Override
+	public double getWidth() {
+		return LCRend.nodeWidth + LCRend.nodeBfr * 2.0;
+	}
+
+	@Override
+	public double getHeight() {
+		return LCRend.fontSize + 5.0 + LCRend.nodeBfr * 3.0 + ((double)incFiles.size()) * (LCRend.fontSize/2.0 + 5.0) + ((double)(incFiles.size()-1)) * (LCRend.nodeBfr * 1.5);
+	}
+
+	@Override
+	public String setParam(int param, Object data) {
+		return "Error: Does not accept attributes";
+	}
+
+	@Override
+	public Object getParam(int param) {
+		return null;
+	}
+
+	@Override
+	public boolean handleClick(double mx, double my, int button, LCWindow window) {
+		if (insb != null)
+		{
+			int c = LCButton.handleClickAll(mx, my, button, insb, window)	;
+			if (c >= 0)
+			{
+				incFiles.add(c, "(header name)");
+				tbs = null;
+				return true;
+			}
+		}
+		if (delb != null)
+		{
+			int c = LCButton.handleClickAll(mx, my, button, delb, window)	;
+			if (c >= 0)
+			{
+				incFiles.remove(c);
+				tbs = null;
+				return true;
+			}
+		}
+		if (tbs != null)
+		{
+			if (LCTextBox.handleClickAll(mx, my, button, tbs, window))
+			{
+				for (int i=0; i<tbs.size(); i++)
+					incFiles.set(i, tbs.get(i).text);
+				return true;
+			}
+		}
+		return false;
+	}
+
+	@Override
+	public void move(LCNode newParent) {
+		parent.releaseChild(this);
+		parent = newParent;
+	}
+
+	@Override
+	public void releaseChild(LCNode child) {		
+	}
+
+	@Override
+	public void setWindow(LCWindow window) {
+		this.window = window;
+	}
+
+	@Override
+	public LCWindow getWindow() {
+		return window;
+	}
+
+	@Override
+	public String getName() {
+		return "includes";
+	}
+
+}

File Li3-C/src/main/LCLoop.java

+package main;
+
+import java.awt.Color;
+import java.awt.Graphics2D;
+import java.io.Serializable;
+import java.util.ArrayList;
+
+public class LCLoop implements LCNode, Serializable {
+	
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = -7674571472133947308L;
+	LCWindow window;
+	LCNode parent;
+	String cond;
+	LCNode block;
+	ArrayList<LCTextBox> tbs;
+	
+	@Override
+	public void init(LCNode parent) {
+		this.parent = parent;
+		block = new LCBlock();
+		block.init(this);
+		tbs = null;
+		cond = "(condition)";
+	}
+
+	@Override
+	public LCNode[] getChildren() {
+		LCNode [] ret = new LCNode[1];
+		ret[0] = block;
+		return ret;
+	}
+
+	@Override
+	public LCNode getParent() {
+		return this;
+	}
+
+	@Override
+	public String genCode(int language, int indent) {
+		String code = LCCompiler.indent(indent) + "while (" + cond + ")\n";
+		code += block.genCode(language, indent);
+		return code;
+	}
+
+	@Override