Differences between revisions 1 and 30 (spanning 29 versions)
Revision 1 as of 2021-02-01 18:12:05
Size: 56
Editor: zbjxb
Comment:
Revision 30 as of 2021-02-04 18:50:30
Size: 901
Editor: zbjxb
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
在这里详述 compiler/Let's build a compiler/ch2。 = Parse和Translate数学表达式 =
希望看到的产出:一系列执行期望动作的汇编语句

== 目标表达式 ==
{{{x = 2*y + 3/(4*z)}}}

=== single digits ===
将expression定义为single digit并输出解析它的汇编语句

||<#00FF00>输入单个数字测试程序通过||

=== binary expressions ===
将expression扩展为二元表达式并输出相应汇编语句.
{{{
                         1+2
     or 4-3
     or, in general, <term> +/- <term>
}}}
||<#00FF00>输入1+2 Pass||
||<#FF0000>输入单个数字 Failed||

=== general expressions ===
{{{
     <expression> ::= <term> [<addop> <term>]*
}}}

=== using the stack ===
{{{
     1+(2-(3+(4-5)))
}}}
由该表达式引出的问题。凡事有记录现场并转而干其他事情的情景,可能都需要Stack。
----
<<FootNote(scheme/call-with-current-continuation)>>

Parse和Translate数学表达式

希望看到的产出:一系列执行期望动作的汇编语句

目标表达式

x = 2*y + 3/(4*z)

single digits

将expression定义为single digit并输出解析它的汇编语句

输入单个数字测试程序通过

binary expressions

将expression扩展为二元表达式并输出相应汇编语句.

                         1+2
     or                  4-3
     or, in general, <term> +/- <term>

输入1+2 Pass

输入单个数字 Failed

general expressions

     <expression> ::= <term> [<addop> <term>]*

using the stack

     1+(2-(3+(4-5)))

由该表达式引出的问题。凡事有记录现场并转而干其他事情的情景,可能都需要Stack。


1

  1. scheme/call-with-current-continuation (1)

compiler/Let's build a compiler/ch2 (last edited 2021-02-15 18:05:22 by zbjxb)