handouts/ho06.tex
changeset 595 4bf0096bc06b
parent 594 d40d7d7b85bc
child 799 85267be9a5ed
equal deleted inserted replaced
594:d40d7d7b85bc 595:4bf0096bc06b
     1 
     1 
       
     2 % !TEX program = xelatex
     2 \documentclass{article}
     3 \documentclass{article}
     3 \usepackage{../style}
     4 \usepackage{../style}
     4 \usepackage{../langs}
     5 \usepackage{../langs}
     5 \usepackage{../grammar}
     6 \usepackage{../grammar}
     6 
     7 
   896 \noindent
   897 \noindent
   897 Note that we call \pcode{parse_all}, not \pcode{parse}.  The examples
   898 Note that we call \pcode{parse_all}, not \pcode{parse}.  The examples
   898 should be quite self-explanatory. The last two example do not produce
   899 should be quite self-explanatory. The last two example do not produce
   899 any integer result because our parser does not define what to do in
   900 any integer result because our parser does not define what to do in
   900 case of division (could be easily added), but also has no idea what to
   901 case of division (could be easily added), but also has no idea what to
   901 do with whitescpaces. To deal with them is the task of the lexer! Yes,
   902 do with whitespaces. To deal with them is the task of the lexer! Yes,
   902 we can deal with them inside the grammar, but that would render many
   903 we can deal with them inside the grammar, but that would render many
   903 grammars becoming unintelligible, including this one.\footnote{If you
   904 grammars becoming unintelligible, including this one.\footnote{If you
   904   think an easy solution is to extend the notion of what a number
   905   think an easy solution is to extend the notion of what a number
   905   should be, then think again---you still would have to deal with
   906   should be, then think again---you still would have to deal with
   906   cases like \texttt{\Grid{(\VS (\VS 2+3)\VS )}}. Jusat think you have
   907   cases like \texttt{\Grid{(\VS (\VS 2+3)\VS )}}. Just think of the mess 
   907   a grammar for a full-blown language where there are numerous such cases.}
   908   you would have in a grammar for a full-blown language where there are 
       
   909   numerous such cases.}
   908 
   910 
   909 \end{document}
   911 \end{document}
   910 
   912 
   911 %%% Local Variables: 
   913 %%% Local Variables: 
   912 %%% mode: latex  
   914 %%% mode: latex