User:VasilievVV/InlineScripts

From mediawiki.org
<program> ::= <stmts>
<stmts> ::= <stmts> <stmt> | <stmt>

<stmt> ::= <expr> semicolon
<stmt> ::= if leftbrace <expr> rightbrace <stmt>
<stmt> ::= if leftbrace <expr> rightbrace <stmt> else <stmt>
<stmt> ::= foreach leftbrace  <lvalue> in <expr> rightbrace <stmt>
<stmt> ::= try <stmt> catch leftbrace <lvalue> rightbrace <stmt>
<stmt> ::= leftcurly <stmts> rightcurly

<expr> ::= <exprSet>
<exprSet> ::= <lvalue> setto <exprSet> | <exprTrinary>
<exprTrinary> ::= <exprLogical> trinary <exprTrinary> colon <exprTrinary> | <exprLogical>
<exprLogical> ::= <exprLogical> logicop <exprCompare> | <exprCompare>
<exprCompare> ::= <exprCompare> comareop <exprEquals> | <exprEquals>
<exprEquals> ::= <exprSum> equalsto <exprSum> | <exprSum>
<exprSum> ::= <exprSum> sum <exprMul> | <exprMul>
<exprMul> ::= <exprMul> mul <exprPow> | <exprPow>
<exprPow> ::= <exprInvert> pow <exprPow> | <exprInvert>
<exprInvert>  ::= invert <exprKeyword> | <exprKeyword>
<exprKeyword> ::= <exprUnary> in <exprUnary> | <exprUnary> contains <exprUnary> | <exprUnary>
<exprUnary> ::= sum <exprFunction> | <exprFunction>
<exprFunction> ::= id leftbrace <commaListPlain> rightbrace | id leftbrace rightbrace
<exprFunction> ::= <varfunc> leftbrace <lvalue> rightbrace | <exprAtom>
<exprAtom> ::= <lvalue> | <atom> | leftbrace <expr> rightbrace | leftsquare <commaList> rightsquare

<varfunc> ::= isset | unset
<commaList> ::= <commaListAssoc> | <commaListPlain>
<commaListPlain> ::= <commaListPlain> comma <expr> | <expr>
<commaListAssoc> ::= <commaListAssoc> comma <keyValue> | <keyValue>
<keyValue> ::= <expr> colon <expr>
<atom> ::= string | int | float | true | false | null
<lvalue> ::= id <arrayIdxs> | id
<arrayIdxs> ::= <arrayIdxs> <arrayIdx> | <arrayIdx>
<arrayIdx> ::= leftsquare <expr> rightsquare | leftsquare rightsquare