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 |