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 override void DeclareVariable(string varname, bool isread) { CCFile file = M_Parent as CCFile; file.DeclareGlobalVariable(varname); }