|
Syntax - Pod file describing syntax understood by Language::Basic module |
Syntax - Pod file describing syntax understood by Language::Basic module
There is no Language::Basic::Syntax module. This is just a pod file describing the syntax that's supported by the Language::Basic module.
Things in italics are objects. Things in boldface are actual strings (reserved words or punctuation). ``[]'' means optional, ``...'' means optionally more copies of the same thing, and things between slashes that look like Perl regexps are Perl regexps.
This syntax description probably isn't exactly correct from a computer science standpoint, but the idea is just to show what LB supports.
Arglist must be made up of constant arithmetic expressions.
Var-Names must be scalar variables.
IF Or-Exp THEN Line_Num [ ELSE Line_Num ]
Note that, unlike C or Perl, Boolean values cannot be ``cast'' to non-Boolean (string or numeric) values and vice versa.
By the way, the classes in module Language::Basic::Expression rather closely mimic this syntax description.
Or-Exp
String-Exp + String-Exp
(Arith-Exp)
Lvalue
Function
Constant
Num-Const
Arith-Exp
The Arith-Exp must be made from Str-Exps.
Arith-Exp Rel-Op Arith-Exp
String-Exp Rel-Op String-Exp
( Or-Exp )
String Identifier
Tokens, or atoms, are indivisible pieces of text making up a BASIC program
(Note: Language::Basic only pays attention to case in string constants.)
Note that a comment goes all the way to the end of a line. Colons in a comment do not start a new statement.
|
Syntax - Pod file describing syntax understood by Language::Basic module |