School of Computer Science     University of Windsor

03-60-214: Computer Languages, Grammars and Translators (Winter 2007)
[Home] [Assignments] [Lecture Slides] [Resources] [Calendar] [Find your marks]

[Tiny Language]
[A2 Test Case]

[Home]
[Up]

 

 

A2 Test Case

/** keywords (such as read and if) and identifiers should not
be counted in
comments INT MAIN **/
MAIN f()
BEGIN INT BEGIN END READ WRITE IF ELSE
main begin int begin end read rewrite if else
you are not required to check the syntax of the program; so all these words are
identifers;
except "quoted" strings and keywords
to check how many lines and words I have;
type "wc A2.input" in "luna.cs";
to count the identifers and keywords;
you have to count me one by one;
note that A1_A2 are two identifers;
_ and _____ are not identifiers;
37.25, 12,34, 5+4
ID_ID+ID@IDD special characters such as !@#$% and tab may also appear to test yo
ur
program /** you can put more than one comment line with characters like * and /
ident **
here is some more tricky part:
" test /** this is a quoted string **/ " but /** "this is a /**comment" **/
/** ident ** you can put more than one comment line with characters like * ident / */ ident /** ident *// ident **/
END
 

Instructor: Dr. Jianguo Lu     Email: jlu at uwindsor  Office: 5111 Lambton Tower        Phone: 519.253.3000 ext 3786


Last updated: March 04, 2007.