Re: [作业] compiler homework5

楼主: yndhpam   2007-06-13 02:23:13
原来是这样,谢谢助教回答
再问一个问题..
如果是undeclared variable
印出error后,要假装他有宣告吗?
也就是说下次他又出现的时候,要再印一次error吗?
※ 引述《sophialiege (with friends)》之铭言:
: ※ 引述《yndhpam ()》之铭言:
: : 请问如果是invalid id,那要假设他的type是什么?
: INT
: : 我的直觉是integer,因为也是未经宣告的变量
: : 为什么在test5.p中
: : test5 := a ; 是invalid id+ type mismatched
: 呃 程式生对答案, 但我打错注解@@
: test5 := a
: INT INT 是 invalid id + undeclared variable -> illegal syntax
: : test5 := 123; 只有invalid id
: : a和123的type不是一样的吗?
: test5 := 123
: INT INT 只有 invalid id
作者: sophialiege (with friends)   2007-06-13 10:49:00
再印一次

Links booklink

Contact Us: admin [ a t ] ucptt.com