Context Free Grammar for QRT Input Language Notes: '(' and ')' are non-terminal symbols ( and ) are CFG parens + is one or more than one * lower case strings in grammar are non-terminals * input language is not case sensitive * = blank | newline | tab * args can be separated by optional ',' or ';' * '=' can separate argument name from value or string. = ( | )+ = begin_instances + end_instances = + | ( name | ) begin_bbox end_bbox = | | | | = | foc_length | | file_name | | | = sphere '(' + ')' QRT Ray Tracer Page 1 Context Free Grammar = | name | radius | | pattern | remove = parallelogram '(' + ')' = | name | v1 | vect1 | v2 | vect2 | | pattern | remove = triangle '(' + ')' = | name | v1 | vect1 | v2 | vect2 | | pattern | remove = ring '(' + ')' = | name | v1 | vect1 | v2 | vect2 | rad_1 | rad_2 | | pattern | remove QRT Ray Tracer Page 2 Context Free Grammar = quadratic '(' + ')' = | name | a | b | c | d | xmin | xmax | ymin | ymax | zmin | zmax | dir | | pattern | remove = instance_of '(' + ')' = name | | scale = = sky '(' + ')' = zenith | horiz = default '(' + ')' = | no_shadow | no_lamp | x_res | y_res | aspect | threshold QRT Ray Tracer Page 3 Context Free Grammar = lamp '(' + ')' = | radius | dist | + = observer '(' + ')' = | lookat | up = pattern '(' + ')' = x_size | y_size | name | '(' + ')' = RECTANGLE | CIRCLE | POLYGON = start_x | stary_y | start_z | end_x | end_y | end_z | = radius = | ( POINT '(' , ')' )+ QRT Ray Tracer Page 4 Context Free Grammar = LOC | POS | LOCATION | POSITION = | | | | | fuzz | index | dither | sreflect | reflect = amb = diff = trans = mirror = density = '(' , , ')' = '(' , , ')' = | - | . | - . = + = 0|1|2|3|4|5|6|7|8|9 QRT Ray Tracer Page 5 Context Free Grammar = ( | )+ = a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p| q|r|s|t|u|v|w|x|y|z|_|*|- = QRT Ray Tracer Page 6 Context Free Grammar