###Name ###End ###INTERNAL OUTPUT ###END ###FEATURES WriteOutSymbol Single ###END ###INPUT ASCII ###END ###OUTPUT ##NONATTRIBUTED "{" "}" "(" ")" "[" "]" "@" "~" "»" "«" "?" "!" ":)" ":(" ".#" ".$" "·#" "·$" "," ";" "=" "+" "-" "/" "*" "=?" ">?" "=+ ##END ##RULE = / / / / /' ' ##END ##RULE =(load (load )* ) KLART #DECLARATIONS text res_txt; #END #ACTIONS ACTION load res_txt:-res_txt&" "; res_txt.sub(res_txt.length,1).putchar(char(Intoken)); ACTION KLART if not Writeoutsymbol(res_txt, %"{" , %"·$" ) then begin errorline; outtext("LEX:Reserverat ord är dåligt :"&res_txt); outimage; end; #END ##END ##RULE =(load (load )*) KLART #DECLARATIONS text op_txt; #END #ACTIONS ACTION load op_txt:-op_txt&" "; op_txt.sub(op_txt.length,1).putchar(char(Intoken)); ACTION KLART if not Writeoutsymbol(op_txt,%",",%"$") then begin errorline; outtext("LEX:Operator är dåligt :"&op_txt); outimage; end; #END ##END ##RULE = init (mulAdd )+ KLART #ATTRIBUTES integer Val; #END #ACTIONS ACTION init Val := 0; ACTION mulAdd Val := 10 * Val + Intoken - rank('0'); ACTION KLART &"const" := Val; Write(%"const"); #END ##END ##RULE = load (load ( / ))* KLART #DECLARATIONS text id_txt; character ch; #END #ACTIONS ACTION load id_txt:-id_txt&" "; ch := char(Intoken); ! if letter(ch) And then ch > 'Z' then ch:=char(Rank(ch)-32); !konvertera till stora bokstäver; ! if ch = 'å' then ch := 'Å' else if ch = 'ä' then ch := 'Ä' else if ch = 'ö' then ch := 'Ö'; id_txt.sub(id_txt.Length,1).putchar(ch); ACTION KLART if not WriteOutSymbol(id_txt,%"{",%"nein") then !ifall det det parsas fel; Begin &"id" :- id_txt; Write(%"id"); End; #END ##END ##RULE = '"' (load )* '"' KLART #DECLARATIONS text str_txt; #END #ACTIONS ACTION load str_txt:-str_txt&" "; str_txt.sub(str_txt.Length,1).putchar(char(Intoken)); ACTION KLART &"string" :- str_txt; Write(%"string"); #END ##END ##RULE = / 'å' / 'Å' / 'ò' / 'Ò' / 'ô' / 'Ô' / 'ù' / 'Ù' / 'õ' / 'Õ' / 'é' / 'É' / 'ï' / 'Ï' / 'ð' / 'Ð' / 'þ' / 'Þ' / 'á' / 'Á' / 'ó' / 'Ó' / 'ä' / 'Ä' / 'æ' / 'Æ' / 'ç' / 'Ç' / 'è' / 'È' / 'ê' / 'Ê' / 'ë' / 'Ë' / 'ì' / 'Ì' / 'ö' / 'Ö' / 'ä' / 'Ä' / 'ú' / 'Ú' / 'ø' / 'Ø' / 'ã' / 'Ã' / 'ö' / 'Ö' / 'â' / 'Â' ##END ##RULE = / '_' / '¤' / '^' / '`' / '%' / '£' / '§' / 'ª' / '¼' / '¾' / '±' / '¡' / '²' / '¢' / '³' / '¤' / 'µ' / '¦' / '¯' / '¸' / '¨' / '¹' / '©' / '°' / '½' / '¿' / 'ñ' / 'Ñ' / '÷' / '×' / '¬' / '®' / 'º' / '­' / 'ß' ##END ##RULE = '{' / '}' / '(' / ')' / '[' / ']'/ '@' / '~' / '»' / '«' / '?' / '!' / ':' / '.' / '·' ##END ##RULE = '$' / '#' / '(' / ')' ##END ##RULE = ','/ ';' / '=' / '+' / '-' / '/' / '*' / '>' / '<' / '&' / '|' / '\' / '#' / '$' ##END ##RULE = '?' ##END ##RULE = / / '#'/ '$' / / / ' ' / ##END ###END