[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

A.1 Details of syntax

<expression>:
    ‘(’<expression>‘)’
    <expression> <binary operator> <expression>
    ‘+’ <expression>
    ‘-’ <expression>
    <left value>
    <left value> <assignment operator> <expression>
    <left value> ‘++’
    <left value> ‘--’
    ‘++’ <left value>
    ‘--’ <left value>
    ‘!’ <expression>
    <expression> ‘?’ <expression> ‘:’ <expression>
    <function> ‘(’ <expr list> ‘)’
    <function> ‘(’ <expr list> ‘|’ <option list> ‘)’
    <string>
    <exponent vector>
    <atom>
    <list>

(See section various expressions.)

<left value>:
    <program variable> [‘[’<expression>‘]’]*
<binary operator>:
    ‘+’ ‘-’ ‘*’ ‘/’ ‘%’ ‘^’(exponentiation)
    ‘==’ ‘!=’ ‘<’ ‘>’ ‘<=’ ‘>=’ ‘&&’ ‘||’
    ‘==’ ‘!=’ ‘<’ ‘>’ ‘<=’ ‘>=’ ‘&&’ ‘||
<assignment operator>:
    ‘=’ ‘+=’ ‘-=’ ‘*=’ ‘/=’ ‘%=’ ‘^=
<expr list>:
    <empty>
    <expression> [‘,’ <expression>]*
<option>:
    Character sequence beginning with an alphabetical letter ‘=’ <expr>
<option list>:
    <option>
    <option> [‘,’ <option>]*
<list>:
    ‘[’ <expr list> ‘]
<program variable>:
   Sequence of alphabetical letters or numeric digits or _
   that begins with a capital alphabetical letter
   (X,Y,Japan etc.)

(See section variables and indeterminates.)

<function>:
   Sequence of alphabetical letters or numeric digits or _
   that begins with a small alphabetical letter
   (fctr,gcd etc.)
<atom>:
   <indeterminate>
   <number>
<indeterminate>:
   Sequence of alphabetical letters or numeric digits or _
   that begin with a small alphabetical letter
   (a,bCD,c1_2 etc.)

(See section variables and indeterminates.)

<number>:
   <rational number>
   <floating point number>
   <algebraic number>
   <complex number>

(See section Types of numbers.)

<rational number>:
   0, 1, -2, 3/4
<floating point number>:
   0.0, 1.2e10
<algebraic number>: 
   newalg(x^2+1), alg(0)^2+1

(See section Algebraic numbers.)

<complex number>:
   1+@i, 2.3*@i
<string>:
   character sequence enclosed by two ‘"’'s.
<exponent vector>:
   ‘<<’ <expr list> ‘>>

(See section Groebner basis computation.)

<statement>:
    <expression> <terminator>
    <compound statement>
    ‘break’ <terminator>
    ‘continue’ <terminator>
    ‘return’ <terminator>
    ‘return’ <expression> <terminator>
    ‘if’ ‘(’ <expr list> ‘)’ <statement>
    ‘if’ ‘(’ <expr list> ‘)’ <statement> ‘else’ <statement>
    ‘for’ ‘(’ <expr list> ‘;’ <expr list> ‘;’ <expr list> ‘)’ <statement>
    ‘do’ <statement> ‘while’ ‘(’ <expr list> ‘)’ <terminator>
    ‘while’ ‘(’ <expr list> ‘)’ <statement>
    ‘def’ <function> ‘(’ <expr list> ‘)’ ‘{’ <variable declaration> <stat list> ‘}’
    ‘end(quit)’ <terminator>

(See section statements.)

<terminator>:
    ‘;’ ‘$
<variable declaration>:
    [‘extern’ <program variable> [‘,’ <program variable>]* <terminator>]*
<compound statement>:
    ‘{’ <stat list> ‘}
<stat list>:
    [<statement>]*

[ << ] [ < ] [ Up ] [ > ] [ >> ]

This document was generated on October 24, 2017 using texi2html 5.0.