public virtual void DeclareVariable(string varname, bool isread) { CodeContainer rep; if (!m_localSymbolTable.Contains(varname)) { if (isread) { m_file.DeclareGlobalVariable(varname); } else { rep = new CodeContainer(CodeBlockType.CB_CODEREPOSITORY, this); m_localSymbolTable.Add(varname); rep.AddCode("float " + varname + ";\n", CodeContextType.CC_NA); CEmmitableCodeContainer compoundst = GetChild(CodeContextType.CC_FUNCTIONDEFINITION_BODY); compoundst.AddCode(rep, CodeContextType.CC_COMPOUNDSTATEMENT_DECLARATIONS); } } }
public CExpressionStatement(CEmmitableCodeContainer parent) : base(CodeBlockType.CB_EXPRESSIONSTATEMENT, parent, 1) { }
public CIfStatement(CEmmitableCodeContainer parent) : base(CodeBlockType.CB_IFSTATEMENT, parent, 3) { }
public CCFunctionDefinition(CEmmitableCodeContainer parent) : base(CodeBlockType.CB_FUNCTIONDEFINITION, parent, 2) { m_file = parent as CCFile; }
public CWhileStatement(CEmmitableCodeContainer parent) : base(CodeBlockType.CB_WHILESTATEMENT, parent, 2) { }
public CCompoundStatement(CEmmitableCodeContainer parent) : base(CodeBlockType.CB_COMPOUNDSTATEMENT, parent, 2) { }
public CReturnStatement(CEmmitableCodeContainer parent) : base(CodeBlockType.CB_RETURNSTATEMENT, parent, 1) { }