\subsection {Абстрактный синтаксис (AS)}
\begin{alltt}

t.Syntax            ::= t.Module | t.Interface
t.Module            ::= (MODULE t.ModuleName e.ModuleBody)
t.Interface         ::= (INTERFACE t.InterfaceName
                    e.InterfaceBody)
t.ModuleName        ::= t.Name
t.InterfaceName     ::= t.Name
e.ModuleBody        ::= t.Item | e.ModuleBody t.Item 
t.Item              ::= t.Function | t.Object | t.Const
s.Linkage           ::= s.IntLinkage | s.ExtLinkage
s.IntLinkage        ::= EXPORT | LOCAL
s.ExtLinkage        ::= IMPORT
t.Function          ::= (s.IntLinkage s.FunctionTag t.Pragma
                    t.FunctionName t.InputParam 
                    t.OutputParam e.Sentence) 
                    |(s.ExtLinkage s.FunctionTag t.Pragma
                    t.FunctionName t.InputParam t.OutputParam)
s.FunctionTag       ::= FUNC | FUNC?
t.FunctionName      ::= t.Name
t.InputParam        ::= (e.ListParam)
t.OutputParam       ::= (e.ListParam)
e.ListParam         ::= /*Empty*/ | e.ListParam t.Param
t.Param             ::= (SVAR) | (EVAR) | (TVAR) | (VVAR) 
                    | (PAREN e.ListParam)
e.Sentence          ::= /*Empty*/ | t.Statement e.Sentence
t.Statement         ::= t.Action | t.Operator | t.branch 
                    | t.ComplexOperator | t.Pragma | t.Format
t.Format            ::= (FORMAT t.Pragma e.HardExpression)
e.HardExpression    ::= e.HardTerms
                    | e.HardTerms t.EVar e.HardTerms 
                    | e.HardTerms t.VVar e.HardTerms
e.HardTerms         ::= /*Empty*/ | t.HardTerm e.HardTerms
t.HardTerm          ::= t.Symbol | (PAREN e.HardExpression) 
                    | t.SVar | t.TVar
t.Operator          ::= (CUT) | (CUTALL t.Pragma) 
                    | (STAKE) | NOFAIL  
                    | (FAIL t.Pragma) | (ERROR t.pragma)
t.ComplexOperator   ::= (NOT t.Branch) 
                    |(ITER t.IterBody t.IterVars t.IterCondition) 
                    |(TRY t.TrySentence e.Nofail t.CatchSentence)
t.IterBody          ::= t.branch
t.IterVars          ::= t.Format
t.IterCondition     ::= t.branch
t.TrySentence       ::= t.branch
t.CatchSentence     ::= t.block | t.branch
t.Action            ::= t.Pattern | t.Result | t.Format | t.Block
t.Block             ::= (BLOCK t.Pragma e.Branches)
                    | (BLOCK? t.Pragma e.Branches)
e.Branches          ::= /*Empty*/ | t.Branch e.Branches
t.Branch            ::= (BRANCH t.Pragma e.Sentence) 
t.Pattern           ::= (LEFT t.Pragma e.PatternExpression) 
                    |(RIGHT t.Pragma e.PatternExpression)
e.PatternExpression ::= /*Empty*/ 
                    | t.PatternTerm  e.PatternExpression
t.PatternTerm       ::= t.Symbol | (PAREN e.PatternExpression) 
                    | t.Variable
t.Variable          ::= t.EVar | t.VVar | t.TVar | t.Svar
t.EVar              ::= (EVAR t.Pragma t.Name)
t.VVar              ::= (VVAR t.Pragma t.Name)
t.TVar              ::= (TVAR t.Pragma t.Name)
t.SVar              ::= (SVAR t.Pragma t.Name)
t.Name              ::= (e.QualifiedName)
e.QualifiedName     ::= s.Word | e.QualifiedName  s.Word
t.Result            ::= (RESULT t.Pragma e.ResultExpression) 
e.ResultExpression  ::= /*Empty*/ 
                    | t.ResultTerm e.ResultExpression
t.ResultTerm        ::= t.Symbol | t.Variable | t.block 
                    |(PAREN e.ResultExpression)
                    |(CALL t.Pragma t.FunctionName e.ResultExpression)
s.Symbol            ::= s.ObjectSymbol | (REF t.Name)
s.ObjectSymbol      ::= s.Symbol
t.Object            ::= (s.Linkage s.ObjectType t.pragma t.ObjectName)
s.ObjectType        ::= TABLE | BOX | STRING | VECTOR | CHANNEL
t.ObjectName        ::= t.Name
t.Initializer       ::= (EXEC e.ResultExpression)
t.Pragma            ::= (PRAGMA t.PragmaFile t.PragmaLine)
t.PragmaFile        ::= (FILE e.FileName)
e.FileName          ::= s.symbol | s.symbol e.FileName
t.PragmaLine        ::= (LINE s.Line s.Column)
s.Line              ::= s.Number
s.Column            ::= s.Number
t.PragmaTrace       ::= (TRACE e.TraceNames) ///???
e.TraceNames        ::= /*Empty*/ | t.TraceName e.TraceNames
t.TraceName         ::= t.Name
t.Const             ::=(s.ExtLinkage CONST t.pragma t.ConstName)
                    |(s.IntLinkage CONST t.pragma t.ConstName 
                    e.ConstExpression)
t.ConstName         ::= t.Name
e.ConstExpression   ::= /*Empty*/ 
                    | t.ConstTerm e.ConstExpression
t.ConstTerm         ::= t.Symbol | (PAREN e.ConstExpression)
                    | t.Variable
s.Word              ::= \emph{символ-слово (в смысле Рефал Плюс)}
s.Number            ::= \emph{символ-число (в смысле Рефал Плюс)}
s.Symbol            ::= \emph{символ-литера (в смысле Рефал Плюс)}
\end{alltt}
