Contents (hide)

Homework Assignment 3

Files

F.A.Q for Exercise 4

  1. Q: CUP doesn't support Kleene closure so how can I implement lists? A: Context-free grammars can easily express all regular expressions so just express lists by appropriate grammar rules.
  2. Q: What about the associativity of the various operators? A: The operators +, -, *, /, ||, && all associate to the left. All other operators are non-associative. The priority between operators is given by the following list, starting from the weakest: choose, ||, &&, !, <, <=, >, >= , ==, !=, +, -, *, /, unary -, in.

Notes

  1. Please notice the minor change in the grammar of ADTL for PathElement.
  2. For some reason the parsing project is unable to locate the templates file on some platforms. Also, I've added a template for INT so that now you have two ways of treating integer terminals - either returning a Java Integer or constructing an INT object. You downloaded the updated project (make sure to save a copy of your ADTL.cup file to avoid overwriting it and losing your work).

Forum

Use the forum below to discuss this assignment.

Note: Please start the subject of your post by stating the exercise you refer to.

10 last forum topics

by markbl - Friday, 27 December 2013 16:59:35
last update: 29 Dec 2013 14:36:27 by zatulovs

by razboy - Friday, 27 December 2013 19:29:40
last update: 28 Dec 2013 19:53:31 by romanm

by gerzi - Tuesday, 24 December 2013 21:58:57
last update: 25 Dec 2013 15:54:09 by romanm

by chenbar - Tuesday, 24 December 2013 23:02:43
last update: 25 Dec 2013 15:53:10 by romanm

by papigers - Tuesday, 24 December 2013 12:14:25
last update: 25 Dec 2013 10:28:04 by zatulovs

by gerzi - Tuesday, 24 December 2013 22:40:06
last update: 25 Dec 2013 10:14:31 by romanm

by chenbar - Monday, 23 December 2013 20:13:31
last update: 23 Dec 2013 22:38:38 by romanm

by efratmu - Monday, 23 December 2013 19:29:42
last update: 23 Dec 2013 19:38:15 by romanm

by orencasp - Wednesday, 18 December 2013 21:40:34
last update: 23 Dec 2013 11:02:56 by zatulovs

by yakiry - Saturday, 21 December 2013 13:19:01
last update: 22 Dec 2013 21:46:55 by zatulovs

Show all 30 forum topics



Add new topic