2.4.3.41. ex_IsCommandThis

[<<<] [>>>]

This is the most general syntax analysis function that tries to match the syntax of the actual line syntax provided in argument p against the token list at the actual position.

The function has several side effects altering optionally the global and local variable table, define user defined functions and so on.

The function signals the success of its operation via the argument piFailure setting the int pointed by it to be zero or the error code.

If the syntax does not match the token list then the function cleans up all its actions if possible to allow the caller to iterate over to the next syntax defintion. In such a situation *piFailure is set EX_ERROR_SYNTAX

If the syntax does not match the token list but the analysis went too far and had side effects that cannot be reversed then no cleanup is made. In such a situation *piFailure is set EX_ERROR_SYNTAX_FATAL.

*piFailure is also set to this value if the syntax definition reaches a "star" point. If the syntax analysis matches a line up to a "star" point then the line should match that syntax definition or is known erroneous. For example a command starting with the two keywords 'declare' 'command' after these two keywords reach a "star" point because no other line syntax but extrenal command declaration starts with these two keywords. In such a situation signalling fatal syntax error saves the compiler time to check other syntax definition.

A "star" point is named this way, because the file syntax.def uses the character * to denote this point in the syntax definitions.

peNODE ex_IsCommandThis(peXobject pEx,
                        pLineSyntax p,
                        int *piFailure
  ){
If the syntax analysis fully matches the syntax definition provided in the argument then the function returns the node that was generated. If more then one nodes were generated during the syntax analysis of the line then the root node of the generated nodes is returned.
[<<<] [>>>]