parrotcode: builtin and user defined macros | |
Contents | Language Implementations | M4 |
builtin.pir - builtin and user defined macros
Copyright: 2004 Bernhard Schmalhofer. All Rights Reserved. CVS Info: $Id$ History: Ported from GNU m4 1.4 References: http://www.gnu.org/software/m4/m4.html
Code for all builtin macros, initialisation of symbol table, and expansion of user defined macros.
Initialise all builtin and predefined macros.
Initialise all builtin and predefined macros.
Install a builtin macro with name 'name', bound to the function 'bp'.
Define a predefined or user-defined macro, with name 'name', and expansion 'text'. This function is also called from main().
The function define_macro is common for the builtins "define", "undefine", "pushdef" and "popdef". ARGC and ARGV is as for the caller, and MODE argument determines how the macro name is entered into the symbol table.
Mostly for debugging. TODO: This is broken for multiple input files. TODO: This is broken when the path seperator is not '/'
Decrease a number.
Define a user defined macro.
Print to standard error. The individual arguments are seperated by a blank.
Integer arithmetics.
Frontend for printf like formatting.
A conditional. Check whether a macro is defined.
A conditional. Can also be used a block comment or as a switch statement.
Increase a number.
The macro expands to the first index of the second argument in the first argument.
Expand to the length of the first argument.
The macro "substr" extracts substrings from the first argument, starting from the index given by the second argument, extending for a length given by the third argument. If the third argument is missing, the substring extends to the end of the first argument.
Execute a shell command and don't return the return code.
Return the exit status of the last syscmd.
Define a user defined macro.
A placeholder for unimplemented functions.
|