SCM Repository
[diderot] / trunk / doc / report / grammar-defs.tex |
View of /trunk/doc/report/grammar-defs.tex
Parent Directory
|
Revision Log
Revision 97 -
(download)
(as text)
(annotate)
Thu May 27 19:47:26 2010 UTC (10 years, 10 months ago) by jhr
File size: 5230 byte(s)
Thu May 27 19:47:26 2010 UTC (10 years, 10 months ago) by jhr
File size: 5230 byte(s)
Created Didirot report document
%!TEX root = report.tex % % Macros for the various rules of the Diderot grammar. We collect the % grammer into these macros to ensure consistency between the collected % syntax and the body of the text. % \newcommand{\ProgramRULES}{ \begin{Rules}{Program} \RHS{\LISTONE{\nt{Declaration}}} \end{Rules}} \newcommand{\DeclarationRULES}{ \begin{Rules}{Declaration} \RHS{\nt{InputDecl}} \RHS{\nt{VarDecl}} \RHS{\nt{ActorDecl}} \RHS{\nt{CoordinationDecl}} \end{Rules}} \newcommand{\InputDeclRULES}{ \begin{Rules}{InputDecl} \RHS{\kw{input} \nt{Type} \term{Id} \OPTGRP{\kw{=} \nt{Expr}} \kw{;}} \end{Rules}} \newcommand{\ActorDeclRULES}{ \begin{Rules}{ActorDecl} \RHS{\kw{actor} \term{Id} \kw{(} \nt{Params} \kw{)} \kw{\{} \LISTGRP{\nt{VarDecl}} \LISTONEGRP{\nt{ActorMethod}} \kw{\}}} \end{Rules}} \newcommand{\ParamsRULES}{ \begin{Rules}{Params} \RHS{\OPTGRP{\nt{Param} \LISTGRP{\kw{,} \nt{Param}}}} \end{Rules}} \newcommand{\ParamRULES}{ \begin{Rules}{Param} \RHS{\nt{Type} \term{Id}} \end{Rules}} \newcommand{\ActorMethodRULES}{ \begin{Rules}{ActorMethod} \RHS{\term{Id} \nt{Block}} \end{Rules}} \newcommand{\BlockRULES}{ \begin{Rules}{Block} \RHS{\kw{\{} \LISTGRP{\nt{Stmt}} \kw{\}}} \end{Rules}} \newcommand{\StmtRULES}{ \begin{Rules}{Stmt} \RHS{\nt{Block}} \RHS{\nt{VarDecl}} \RHS{\kw{stabilize} \kw{;}} \RHS{\kw{die} \kw{;}} \RHS{\kw{new} \term{Id} \kw{(} \nt{Arguments} \kw{)} \kw{;}} \RHS{\term{Id} \kw{=} \nt{Expr} \kw{;}} \RHS{\kw{if} \kw{(} \nt{Expr} \kw{)} \nt{Stmt} \kw{else} \nt{Stmt}} \RHS{\kw{if} \kw{(} \nt{Expr} \kw{)} \nt{Stmt}} \end{Rules}} \newcommand{\VarDeclRULES}{ \begin{Rules}{VarDecl} \RHS{\nt{Type} \term{Id} \kw{=} \nt{Expr} \kw{;}} \end{Rules}} \newcommand{\TypeRULES}{ \begin{Rules}{Type} \RHS{\kw{image} \kw{(} \nt{Dimension} \kw{)} \nt{Dimensions}} \RHS{\kw{field} \kw{\#} \nt{Dimension} \kw{(} \nt{Dimension} \kw{)} \nt{Dimensions}} \RHS{\kw{kernel} \kw{\#} \nt{Dimension}} \RHS{\nt{ValueType} \LISTGRP{\kw{[} \nt{Dimension} \kw{]}}} \end{Rules}} \newcommand{\CoordinationDeclRULES}{ \begin{Rules}{CoordinationDecl} \RHS{\kw{initially} \nt{\GRP{\nt{Array} $\;|\;$ \nt{Collection}}} \kw{;}} \end{Rules}} \newcommand{\ArrayRULES}{ \begin{Rules}{Array} \RHS{\kw{[} \nt{Create} \kw{|} \nt{Iterations} \kw{]}} \end{Rules}} \newcommand{\CollectionRULES}{ \begin{Rules}{Collection} \RHS{\kw{\{} \nt{Create} \kw{|} \nt{Iterations} \kw{]}} \end{Rules}} \newcommand{\CreateRULES}{ \begin{Rules}{Create} \RHS{\term{Id} \kw{(} \nt{Arguments} \kw{)}} \end{Rules}} \newcommand{\IterationsRULES}{ \begin{Rules}{Iterations} \RHS{\nt{Iteration} \LISTONEGRP{\kw{,} \nt{Iteration}}} \end{Rules}} \newcommand{\IterationRULES}{ \begin{Rules}{Iteration} \RHS{\term{Id} \kw{in} \nt{Expr} \kw{..} \nt{Expr}} \end{Rules}} \newcommand{\ExprRULES}{ \begin{Rules}{Expr} \RHS{\nt{AndExpr} \LISTGRP{\kw{||} \nt{AndExpr}}} \end{Rules}} \newcommand{\AndExprRULES}{ \begin{Rules}{AndExpr} \RHS{\nt{CmpExpr} \LISTGRP{\kw{\&\&} \nt{CmpExpr}}} \end{Rules}} \newcommand{\CmpExprRULES}{ \begin{Rules}{AddExprCmpExpr} \RHS{\nt{AddExpr} \LISTGRP{\nt{CmpOp} \nt{AddExpr}}} \end{Rules}} \newcommand{\AddExprRULES}{ \begin{Rules}{AddExpr} \RHS{\nt{MulExpr} \LISTGRP{\nt{AddOp} \nt{MulExpr}}} \end{Rules}} \newcommand{\MulExprRULES}{ \begin{Rules}{MulExpr} \RHS{\nt{PrefixExpr} \LISTGRP{\nt{MulOp} \nt{PrefixExpr}}} \end{Rules}} \newcommand{\PrefixExprRULES}{ \begin{Rules}{PrefixExpr} \RHS{\nt{SelExpr}} \RHS{\kw{-} \nt{PrefixExpr}} \RHS{\kw{!} \nt{PrefixExpr}} \RHS{\kw{D} \nt{PrefixExpr}} \end{Rules}} \newcommand{\SelExprRULES}{ \begin{Rules}{SelExpr} \RHS{\nt{AtomExp} \LISTGRP{\kw{@} \nt{AtomExp} $\;|\;$ \kw{[} \nt{Expr} \kw{]}}} \end{Rules}} \newcommand{\AtomExpRULES}{ \begin{Rules}{AtomExp} \RHS{\term{Id} \OPTGRP{\kw{(} \nt{Arguments} \kw{)}}} \RHS{\nt{ValueType} \kw{(} \nt{Arguments} \kw{)}} \RHS{\term{Int}} \RHS{\term{Float}} \RHS{\term{String}} \RHS{\kw{(} \nt{Expr} \LISTGRP{\kw{,} \nt{Expr}} \kw{)}} \RHS{\kw{$|$} \nt{Expr} \kw{$|$}} \end{Rules}} \newcommand{\ArgumentsRULES}{ \begin{Rules}{Arguments} \RHS{\OPTGRP{\nt{Expr} \LISTGRP{\kw{,} \nt{Expr}}}} \end{Rules}} \newcommand{\CmpOpRULES}{ \begin{Rules}{CmpOp} \RHS{\kw{<}} \RHS{\kw{<=}} \RHS{\kw{==}} \RHS{\kw{!=}} \RHS{\kw{>=}} \RHS{\kw{>}} \end{Rules}} \newcommand{\AddOpRULES}{ \begin{Rules}{AddOp} \RHS{\kw{+}} \RHS{\kw{-}} \end{Rules}} \newcommand{\MulOpRULES}{ \begin{Rules}{MulOp} \RHS{\kw{*}} \RHS{\kw{/}} \end{Rules}} \newcommand{\ValueTypeRULES}{ \begin{Rules}{ValueType} \RHS{\kw{tensor} \nt{Dimensions}} \RHS{\kw{vec2}} \RHS{\kw{vec3}} \RHS{\kw{vec4}} \RHS{\kw{bool}} \RHS{\kw{int}} \RHS{\kw{real}} \RHS{\kw{string}} \end{Rules}} \newcommand{\DimensionsRULES}{ \begin{Rules}{Dimensions} \RHS{\kw{[} \OPTGRP{\nt{Dimension} \LISTGRP{\kw{,} \nt{Dimension}}} \kw{]}} \end{Rules}} \newcommand{\DimensionRULES}{ \begin{Rules}{Dimension} \RHS{\term{Int}} \end{Rules}}
root@smlnj-gforge.cs.uchicago.edu | ViewVC Help |
Powered by ViewVC 1.0.0 |