========================== std/anything : ========================== The `anything' type. ========================== std/autocast : ========================== Add a global automatic implicit type caster; takes a `from' and a `to' type parameters. When the `reciprocal' option is specified at binding, an additionnal caster is added (`to' and `from' types inverted). An optional code block can also be specified (except with `reciprocal' option) to call custom code at casts, then the `from' type parameter is defined in the block with the same syntax as the type itself. Syntax requirements: : : : : ========================== std/bind : ========================== Bind a syntax to a built-in function (called binding) as a new definition; needs a syntax parameter, a parameter named `module' (word or text) and a parameter named `bind' (word or text); a list of options (word parameter named `option') can be specified to apply to the new definition. If the built-in does not exist, it will warn and bind to std/nil instead. Syntax requirements: : : : : : {|} {|} [...]: ========================== std/callcode : ========================== Call an anonymous function, or dump a constant code block literal. If the code parameter is a constant code literal and some additional parameters are specified, it will be rejected. Syntax requirements: :: :[...]: ========================== std/cdata : ========================== Generate a data block, with its content separated by commas (',') instead of semicolons (';') used for code blocks. It takes a code literal, and optionally a return type: if it is a class type, the raw type will be returned; otherwise, an array of the type will be assumed, but the return type will match anything (laxist). Syntax requirements: :: : : ========================== std/class : ========================== Define a class type; takes a word or syntax parameter for the name, and a code block that must contain only calls to : (/): (the natural option specifies the number of bits for the field). If a field has a raw value class type, then the sub class is included in the current (field by content instead of field by pointer). An optional type parameter can be used to specify a parent class, that makes an implicit field named `_parent_' (so it can't be used for other fields). If the bind option `union' is specified, it will make an union instead of a class (in this case, the parent type will be ignored). If the bind option `extern' is set, the type will not be defined in C. If the bind option `struct' is set, no C typedef will be generated. Syntax requirements: : : : : :{|} () : ========================== std/code : ========================== The `code' type. ========================== std/ctype : ========================== Define a new C type, by specifying C syntax; takes a word or syntax parameter for the name of the type, a text parameter for the C prefix, and an optional second text parameter for the C suffix. If the prefix is omitted, it will be guessed from syntax (or word). With bind option `def' a C-typedef will be generated at top level. Syntax requirements: :: : : : : :{|} (): ========================== std/dig : ========================== Dig call path informations according to the syntax of the function or macro inside which this must be called (eg. Is third option set ? Which case of second enumeration is used ? ...); exactly one bind option must be specified amongst `option', `enum' and `list'. It takes a natural(> 0) parameter and optionally, inside macros, other parameters depending on which bind option is set: With `option', if a parameter of type anything is present, its code is generated when the call option is set, otherwise the code of the second parameter of type anything (if present) is generated; without these additional parameters, a 0 or 1 (int) is returned. With `enum', the number (int) of the case is returned, except when a list of parameters of type anything is present, in which case the code of the parameter corresponding to the case is generated. With `list', the length of list is returned, except when a list of parameters of type anything are used, in which case for each occurence in call path, generate code of each parameters specified, eventually separating them with a `sep' parameter. Syntax requirements: :: with option, enum or list : (): with option : [...2,]: with enum : [...1,](): with list ========================== std/dump : ========================== Dump the known value of the first parameter (helps debugging macros). Syntax requirements: :: ========================== std/enum : ========================== Define an enum type with a word (called `name') or syntax, and a list of word called `member', with an optional integer parameter value for each member. Instead of the list of word, a code block can be provided, in which calls will have to match : (= ):. Syntax requirements: :{|} : :{|} [(=)...]: ========================== std/extdef : ========================== Make an external definition with a C identifier (word), a syntax and optionnally a type. If the binding option `func' is specified, an external function is defined, if not, an exnternal variable is defined. If the binding option `Cmacro' is specified, an external C macro is defined instead of a function or variable. This is used by modules interfaces (*.argl). Syntax requirements: : (): ========================== std/extern : ========================== Make an external definition with a C identifier (word), a syntax and optionnally a type. If a syntax is specified, a function is defined, if not, a variable is defined with the identifier as syntax. If no identifier is specified, the syntax must begin by a word which will be used as identifier. If the binding option `nodecl' is specified, no declaration will be generated. Syntax requirements: : (): :{|} (): ========================== std/field : ========================== Call a field of a class or union. It needs a word parameter (field name) and a parameter of type `anything' (the union or class instance). Syntax requirements: : : ========================== std/fieldset : ========================== Generate a field value set statment to be used inside a data block. Needs a word for field name and an `anything' parameter for its value. Also, it refuses to be called inside a subcall. The word parameter may be in a list to generate subfields Syntax requirements: : : :[...] : ========================== std/fsym : ========================== Get the body code of a function; it needs a call to the function as parameter, but this does not actually call the function. Syntax requirements: :: ========================== std/funcdef : ========================== Define a function, a macro or an anonymous function. Needs a syntax, or a word (parameter-less function or macro). When the binding option `macro' is specified, it defines a macro instead of a function. When no word or syntax parameter is specified, an anonymous function is returned. If the binding option `private' is set, the definition is private to the module (not exported; equivalent to `static' in C). If the binding option `Cmacro' is set, it defines a C-macro (with #define) instead of a C function. May also return the function body code, when it's not a macro or C-macro. Syntax requirements: :( {|} ) () : ========================== std/gencode : ========================== Generate code for all its arguments (in a list of any parameter), without separating them. If the binding option `ref' is set, and the first parameter is a text constant literal beginning by any number of `*' and `&' then they will be understood as address of/dereferencing C operators, and they will be compressed for a clearer C output. If the binding option `no_semicolon' is set, the next output line ending semicolon will be inhibited. Syntax requirements: :[...]: ========================== std/genlist : ========================== Generate the list of values of each macro parameter contained in the first syntax list of any parameter named `param'. Options can be specified in a second list enumerating named parameters: `sep' for separator between values; `nomatch' when a parameter is missing, instead of nothing. Syntax requirements: :[...] [ {|} ...]: ========================== std/globally : ========================== Generate the content of a code block at the beginning of output Syntax requirements: :: ========================== std/hinclude : ========================== Include a C source file (a C header). It takes a word or text parameter; if it's a word and the binding option `dot_h' is specified, a `.h' will be added to the end of the file name. The include takes place at the beginning of the output code. With the binding option `system' the #include will have <> instead of "". Syntax requirements: :{|}: ========================== std/integer : ========================== The relative `integer' type. ========================== std/natural : ========================== The `natural' integer type. ========================== std/nil : ========================== Return the null element of the expected context type. ========================== std/nothing : ========================== The `nothing' type. ========================== std/print : ========================== Print its arguments without spaces between them using printf() and supports formatting for the basic types (int, nat, real, word, text, syntax); for other types, it prints a pointer address (%p format). It can also print spaces between arguments, if the bind option `spaced' is specified. If the bind option `error' is set, it will print on standard error rather than the default standard output. Only the first syntax parameter is considered, but it can be in a list. Syntax requirements: :: :[...]: ========================== std/real : ========================== The `real' type. ========================== std/return : ========================== Return from current function, with an optional return value. If it is called from an anonymous function, it will also produce a call to va_end(). Syntax requirements: :(): : : ========================== std/set : ========================== Affect a value to a variable (or reference). It takes a parameter of type `anything' (for the value) and a parameter of type reference to `anything' (for the variable). This is deprecated and should be replaced by a macro. Syntax requirements: : : ========================== std/shiftlist : ========================== Shift values of parameters, options, enumerations and lists contained in the syntax list identified by the parameter named `id' (which must be an integer > 0); an other parameter named `by' may be specified to shift values by more than one. This must be called inside a function or macro. Syntax requirements: : (): ========================== std/stresc : ========================== Generate an escaped text string suitable for inclusion within a double quoted C string. Moreover, if the parameter evaluates to a word, it changes non-ascii characters into hexadecimal sequence. Syntax requirements: :: ========================== std/strunquote : ========================== Generate the content of a constant text character string without quotes. Syntax requirements: :: ========================== std/super : ========================== Select a definition that is not local nor a recursive function call. Syntax requirements: :: :: ========================== std/syntax : ========================== The `syntax' type. ========================== std/syntaxof : ========================== Generate a quoted text string litteral containing the syntax of a given definition, delimiteed with two colons (`:'). Syntax requirements: :: ========================== std/text : ========================== The `text' type. ========================== std/type : ========================== The `type' type. ========================== std/typeconv : ========================== Cast explicitly anything to a particular type. It needs a type parameter and a parameter of type anything, or a reference to anything. If the element to cast is a word, it will be quoted as a text string litteral; if it is a type, its number will be printed unless it is casted to text, in which case it will be quoted. If the binding option `explicit' is set, the type context will not be changed; so if syntax parameter type is `anything', no implicit autocast will be called. Syntax requirements: : : : : ========================== std/typefix : ========================== Generate the prefix or the suffix of a type. If the binding option `prefix' is sepcified, the prefix of the type will be generated. If the binding option `suffix' is specified, the suffix of the type will be generated. If none or both of these options are specified, both the prefix and the suffix (in this order) will be generated. Syntax requirements: :: ========================== std/typeof : ========================== Return the type of the parameter. Syntax requirements: :: ========================== std/typeparam : ========================== Get a parameter that generated the C-type of the parameter of type anything, by name or by type; it corresponds to a parameter in the syntax of the type generating macro. Syntax requirements: : { | }: ========================== std/typeraw : ========================== Return a raw value type from the given class type. Syntax requirements: :: ========================== std/typeref : ========================== Return a reference type from the given (non-reference) type, or the non-raw (and non-reference) version of a raw type. Syntax requirements: :: ========================== std/typeselect : ========================== Select a definition to match a given type (this can be replaced by a macro). The binding option `union' can be specified to select a particular type field of an union. Syntax requirements: : : : : ========================== std/union : ========================== Define a union type with a word or syntax, and a list of types. If the bind option `silent' is specified, a union will never generate a field name when called (e.g. `foobar' instead of `(foobar).u_int'). Syntax requirements: :{|} [...]: ========================== std/use : ========================== Use an external argile source file, importing its global definitions. It takes a first list containing either a word or text parameter, followed by a word or text parameter, which are file names (a `.argl' or `.arg' may be implicitely appended to match real file names). An optional second list of parameters of type syntax, followed by another parameter of type syntax, may be specified to tell which local definitions must be defined before including the list of source files. If the binding option `include' is set, the global definitions exported by the included file will also be exported when current file is used or included. Syntax requirements: :[ {|} , ...] {|} ([ , ...] ): ========================== std/vardef : ========================== Define a variable, giving a name (word) or syntax, an optional type, and an optional initial value. Some of these parameters can also be in a list to define several variables in a single call. It is possible to add a second set of parameters (when the first one is in a list). If the binding option `return' is set, the last variable is returned. If the binding option `private' is set, the variables are made private to the file (static in C). Syntax requirements: :{|} () (): : [ {|} ... 1, ]: : [ {|} () ... 1, ]: :[ () {|} () ... 1, ]: :[ () {|} () ... 1, ] {|} (): ========================== std/word : ========================== The `word' type. ========================== ---------------------------------------------------------------------- Copyright (C) 2009,2010,2011,2014 The Argile authors (See file AUTHORS). Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the file doc/COPYING distributed along with the Argile compiler.