=head1 NAME Syntax - Pod file describing syntax understood by Language::Basic module =head1 SYNOPSIS There is no Language::Basic::Syntax module. This is just a pod file describing the syntax that's supported by the Language::Basic module. =head1 DESCRIPTION Things in I are objects. Things in B 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. =head2 Line Syntax =over 4 =item Line: I I [B<:> I ...] =head2 Statement Syntax =over 4 =item * B I [ B<,> I ...] =item * B I [ I ] [ B<,> I [ I ] ...] I must be made up of constant arithmetic expressions. =item * B I B<(> I [ B<,> I ...] B<)> B<=> I Is must be scalar variables. =item * B =item * B I B<=> I B I [ B I] =item * B I =item * B I B I [ B<:> I ...] [ B I [ B<:> I ...]] B I B I [ B I ] =item * B [ I B<;> ] I [ B<,> I ...] =item * [B] I B<=> I =item * B I =item * B I GOTO/GOSUB I [ B<,> I ...] =item * B [ I [ I ] [ I [ I ] ...] ] =item * B I [ B<,> I ...] =item * I =back =head2 Expression Syntax 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. =over 4 =item I: I I =item I: I I I I B<+> I =item I: I I I =item I: B<-> I (I) I I I =item I: I [ I ] =item I: B<(> I [ B<,> I ...] B<)> =item I: I I =item I: I I =item I: I I The I must be made from Is. =item I: I [ B I ] =item I: I [ B I ] =item I: B I I I I I I I B<(> I B<)> =back =head2 Identifier Syntax =over 4 =item I: I I =item I: /FN[A-Z]\w+/ =item I: /[A-Z]\w*/ =item I: /[A-Z]\w*\$/ =back =head2 Token Syntax Tokens, or atoms, are indivisible pieces of text making up a BASIC program (Note: Language::Basic only pays attention to case in string constants.) =over 4 =item I: /\d+/ =item I: B /.*/ Note that a comment goes all the way to the end of a line. Colons in a comment do not start a new statement. =item I: B | B | B | B | B | B | B | B | B | B | B | B | B | B | B | B | B | B | B =item I: /(\d*)?\.?\d+/ =item I: /".*?"/ =item I: B> | B=> | B> | B=> | B<=> | BE> =item I: B<+> | B<-> =item I: B<*> | B =item I: B<,> | B<;> =back