|parrotcode: Setting up input and reading input|
|Contents | Language Implementations | M4|
input.pir - Setting up input and reading input
Copyright: 2004-2005 Bernhard Schmalhofer. All Rights Reserved. CVS Info: $Id$ History: Ported from GNU m4 1.4 References: http://www.gnu.org/software/m4/m4.html
Initialise some stacks and put them into the Hash state['stack']:
Initialize some PGE rulesubs and put them into the Hash state['rulesub']:
TOOO: recognize nested quoted strings
Stores a filename on a stack TODO: open these files and complain when they don't or pass filehandles
Parse and return a single token from the input stream. A token can either be TOKEN_EOF, if the state['stack';'input'] is empty; it can be TOKEN_STRING for a quoted string; TOKEN_WORD for something that is a potential macro name; and TOKEN_SIMPLE for any single character that is not a part of any of the previous types. | Next_token () return the token type and the token data.
Uses regular expressions for finding tokens.