# Syntactic rules

Syntactic rules of the KVIrc scripting language

In the following table you can find a good part of the KVIrc scripting language syntactic rules.
<entity> indicates a ENTITY THAT CAN APPEAR EXACTLY ONE TIME.
[<entity>] indicates an OPTIONAL ENTITY.
{<entity>} indicates an ENTITY THAT CAN APPEAR ONE OR MORE TIMES.
'entity' indicates a LITERAL ENTITY: written exactly as it is.
<entity1>|<entity2> indicates mutually exclusive choices.
The mutually exclusive choices are often separated in two or more rules (productions), to improve readability.

<command buffer> | [<whitespace>][<command block>]{<command buffer>}
<command buffer> | [<whitespace>][<single command>]{<command buffer>}
<whitespace> | {<space>|<tab>|<newline>}['\'<newline>][<whitespace>]
<space> | ' '['\'<newline>][<space>] (Ascii space character)
<tab> | '\t' (Ascii horizontal tabulation character)
<newline> | '\n' (Ascii line feed (LF) character)
<command block> | '{' <command buffer>[<whitespace>] '}'
<single command> | <comment>
<single command> | <lvalue command> <command terminator>
<single command> | <rvalue command> <command terminator>
<comment> | '#' {<non comment terminator>} <comment terminator>
<comment terminator> | <newline> | <end of string>
<end of string> | No character (internally Ascii character 0)
<command terminator> | <newline> | <end of string> | ';'
<non comment-terminator> | Any Ascii character except <newline> and <end of string>
<simple command> | [<module name>'.']<command name>[<switch list>]{<space>}<command dependant part>
<lvalue command> | <variable>[<space>]<operation>
<lvalue command> | <variable>'->'<object command>
<lvalue command> | <identifier>'->'<object command>
<operation> | <one op operator>
<operation> | <two op operator>[<space>]<param string>
<switch list> | {<space>}'-'<alpha char>[{<space>}'='<single parameter>][<switch list>]
<command name> | <alphanumeric char>{<alphanumeric char>}
<module name> | <alphanumeric char>{<alphanumeric char>}
<alphanumeric char> | Ascii characters 'A' to 'Z' , 'a' to 'z' , '0' to '9' and '_'
<variable> | <global variable> | <local variable>
<global variable> | '%' <uppercase letter> [<alphanumeric char>]['['<param string>']']
<local variable> | '%' <lowercase letter> [<alphanumeric char>]['['<param string>']']
<param string> | [<single parameter>][<space>[<param string>]]
<single parameter> | <variable> | <identifier> | <nonterminator token> | <string>
<nonterminator token> | <nonterminator char>['\'<newline><nonterminator char>]
<nonterminator char> | Any ascii character except <space> and <command terminator>
<command dependant part> | Production in each command help page

To be continued...

Index, Language Overview

KVIrc 4.0.2.4740 Documentation
Generated by root at Tue Feb 1 06:16:04 2011