private void button2_Click(object sender, EventArgs e)
{
listLog.Items.Clear();
tokensResult = null;
try
{
tokensResult = this.scriptService.ParserToken(richTextBox_Code.Text);
using (System.IO.Stream fiels = System.IO.File.OpenWrite(curCodeFile + ".bytes"))
{
this.scriptService.tokenParser.SaveTokenList(tokensResult, fiels);
}
}
catch (Exception err)
{
Log_Error("词法识别失败");
}
using (System.IO.Stream fiels = System.IO.File.OpenRead(curCodeFile + ".bytes"))
{
tokensResult = this.scriptService.tokenParser.ReadTokenList(fiels);
}
//try
//{
if (tokensResult != null && tokensResult.Count > 0)
{
compilerResult = scriptService.Expr_CompilerToken(tokensResult);
//if (compilerResult == null)
//{
// Log("尝试作为表达式编译");
// compilerResult = scriptService.CompilerToken(tokens, true);
//}
//compilerResult = compiler.Optimize(compilerResult);
ShowExp(compilerResult);
}
//}
//catch(Exception err)
//{
// Log_Error("编译失败");
//}
}
void ShowExp(CSLE.ICLS_Expression value)