INCLAN: Commands

From CYANA Wiki
Revision as of 18:15, 11 August 2009 by Guentert (talk | contribs)
Jump to navigation Jump to search

When reading an input command line the command interpreter executes the following steps:

  • An optional comment, i.e. text following a comment sign “#”, is discarded.
  • The values of variables are substituted from right to left.
  • The command line is split into elements, defined as sequences of non-blank characters separated by blank characters. The first element becomes the command name. The following elements become command parameters.
  • If the command name matches a user-defined alias, the alias is expanded.
  • If the command name matches a built-in command of INCLAN, it is executed by the command interpreter itself.
  • Otherwise, if the command name matches a user-defined command (see INCLAN command command below), it is executed by the command interpreter.
  • Otherwise, if the command name matches a command of the underlying program unambiguously, it is executed by the program.
  • Otherwise, the command interpreter looks for a macro with the given command name and, if it is found in the current macro search path, executes it. If no such macro is found, an error occurs.