NAME ^

builtin.imc - builtin and user defined macros

DESCRIPTION ^

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.

SUBROUTINES ^

void _builtin_tab_init( PerlHash state ) ^

Initialise all builtin and predefined macros.

void _builtin_init( PerlHash state ) ^

Initialise all builtin and predefined macros.

void _define_builtin( PerlHash state, string name, string bp ) ^

Install a builtin macro with name 'name', bound to the function 'bp'.

void define_user_macro( PerlHash state, string name, string text ) ^

Define a predefined or user-defined macro, with name 'name', and expansion 'text'. This function is also called from main().

_define_macro ^

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.

_m4_decr ^

Decrease a number.

_m4_define ^

Define a user defined macro.

_m4_eval ^

Integer arithmetics.

_m4_format ^

Frontend for printf like formatting.

_m4_ifdef ^

A conditional. Check wether a macro is defined.

_m4_ifelse ^

A conditional. Can also be used a block comment or as a switch statement.

_m4_incr ^

Increase a number.

_m4_index ^

The macro expands to the first index of the second argument in the first argument.

_m4_len ^

Expand to the length of the first argument.

_m4_substr ^

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.

_m4_syscmd ^

Execute a shell command and don't return the return code.

_m4_sysval ^

Return the exit status of the last syscmd.

_m4_undefine ^

Define a user defined macro.

_m4_not_implemented ^

A placeholder for unimplemented functions.


parrot