INCLAN: Commands: Difference between revisions

From CYANA Wiki
Jump to navigation Jump to search
(Created page with '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. • Th…')
 
No edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
When reading an input command line the command interpreter executes the following steps:
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.
# An optional comment, i.e. text following a comment sign “#”, is discarded.
The values of variables are substituted from right to left.
# 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.
# 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 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.
# 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 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, 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.
# 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.

Latest revision as of 18:49, 30 November 2009

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

  1. An optional comment, i.e. text following a comment sign “#”, is discarded.
  2. The values of variables are substituted from right to left.
  3. 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.
  4. If the command name matches a user-defined alias, the alias is expanded.
  5. If the command name matches a built-in command of INCLAN, it is executed by the command interpreter itself.
  6. Otherwise, if the command name matches a user-defined command (see INCLAN command command below), it is executed by the command interpreter.
  7. Otherwise, if the command name matches a command of the underlying program unambiguously, it is executed by the program.
  8. 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.