Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Diff of /branches/vis12/doc/report/grammar-defs.tex
ViewVC logotype

Diff of /branches/vis12/doc/report/grammar-defs.tex

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

trunk/doc/report/grammar-defs.tex revision 162, Tue Jul 20 18:26:28 2010 UTC branches/vis12/doc/report/grammar-defs.tex revision 2275, Fri Mar 8 12:00:16 2013 UTC
# Line 12  Line 12 
12    \begin{Rules}{Declaration}    \begin{Rules}{Declaration}
13      \RHS{\nt{InputDecl}}      \RHS{\nt{InputDecl}}
14      \RHS{\nt{VarDecl}}      \RHS{\nt{VarDecl}}
15      \RHS{\nt{ActorDecl}}      \RHS{\nt{FuncDecl}}
16        \RHS{\nt{StrandDecl}}
17      \RHS{\nt{CoordinationDecl}}      \RHS{\nt{CoordinationDecl}}
18    \end{Rules}}    \end{Rules}}
19  \newcommand{\InputDeclRULES}{  \newcommand{\InputDeclRULES}{
20    \begin{Rules}{InputDecl}    \begin{Rules}{InputDecl}
21      \RHS{\kw{input} \nt{Type} \term{Id} \OPTGRP{\kw{=} \nt{Expr}} \kw{;}}      \RHS{\kw{input} \nt{Type} \term{Id} \OPTGRP{\kw{=} \nt{Expr}} \kw{;}}
22    \end{Rules}}    \end{Rules}}
23  \newcommand{\ActorDeclRULES}{  \newcommand{\FuncDeclRULES}{
24    \begin{Rules}{ActorDecl}    \begin{Rules}{FuncDecl}
25      \RHS{\kw{actor} \term{Id} \kw{(} \nt{Params} \kw{)} \kw{\{} \LISTGRP{\nt{ActorStateDecl}} \LISTONEGRP{\nt{ActorMethod}} \kw{\}}}      \RHS{\kw{function} \nt{Type} \term{Id} \kw{(} \nt{Params} \kw{)} \kw{=} \nt{Expr} \kw{;}}
26        \RHS{\kw{function} \nt{Type} \term{Id} \kw{(} \nt{Params} \kw{)} \nt{Block}}
27      \end{Rules}}
28    \newcommand{\StrandDeclRULES}{
29      \begin{Rules}{StrandDecl}
30        \RHS{\kw{strand} \term{Id} \kw{(} \nt{Params} \kw{)} \kw{\{} \LISTGRP{\nt{StrandStateDecl}} \LISTONEGRP{\nt{StrandMethod}} \kw{\}}}
31    \end{Rules}}    \end{Rules}}
32  \newcommand{\ParamsRULES}{  \newcommand{\ParamsRULES}{
33    \begin{Rules}{Params}    \begin{Rules}{Params}
# Line 31  Line 37 
37    \begin{Rules}{Param}    \begin{Rules}{Param}
38      \RHS{\nt{ValueType} \term{Id}}      \RHS{\nt{ValueType} \term{Id}}
39    \end{Rules}}    \end{Rules}}
40  \newcommand{\ActorStateDeclRULES}{  \newcommand{\StrandStateDeclRULES}{
41    \begin{Rules}{ActorStateDecl}    \begin{Rules}{StrandStateDecl}
42      \RHS{\OPT{\kw{output}} \nt{VarDecl}}      \RHS{\OPT{\kw{output}} \nt{VarDecl}}
43    \end{Rules}}    \end{Rules}}
44  \newcommand{\ActorMethodRULES}{  \newcommand{\StrandMethodRULES}{
45    \begin{Rules}{ActorMethod}    \begin{Rules}{StrandMethod}
46      \RHS{\term{Id} \nt{Block}}      \RHS{\nt{MethodId} \nt{Block}}
47      \end{Rules}}
48    \newcommand{\MethodIdRULES}{
49      \begin{Rules}{MethodId}
50        \RHS{\kw{update}}
51        \RHS{\kw{stabilize}}
52        \RHS{\term{Id}}
53    \end{Rules}}    \end{Rules}}
54  \newcommand{\BlockRULES}{  \newcommand{\BlockRULES}{
55    \begin{Rules}{Block}    \begin{Rules}{Block}
# Line 49  Line 61 
61      \RHS{\nt{VarDecl}}      \RHS{\nt{VarDecl}}
62      \RHS{\kw{stabilize} \kw{;}}      \RHS{\kw{stabilize} \kw{;}}
63      \RHS{\kw{die} \kw{;}}      \RHS{\kw{die} \kw{;}}
64        \RHS{\kw{return} \nt{Expr} \kw{;}}
65      \RHS{\kw{new} \term{Id} \kw{(} \nt{Arguments} \kw{)} \kw{;}}      \RHS{\kw{new} \term{Id} \kw{(} \nt{Arguments} \kw{)} \kw{;}}
66      \RHS{\term{Id} \kw{=} \nt{Expr} \kw{;}}      \RHS{\term{Id} \kw{=} \nt{Expr} \kw{;}}
67      \RHS{\kw{if} \kw{(} \nt{Expr} \kw{)} \nt{Stmt} \kw{else} \nt{Stmt}}      \RHS{\kw{if} \kw{(} \nt{Expr} \kw{)} \nt{Stmt} \kw{else} \nt{Stmt}}
# Line 60  Line 73 
73    \end{Rules}}    \end{Rules}}
74  \newcommand{\TypeRULES}{  \newcommand{\TypeRULES}{
75    \begin{Rules}{Type}    \begin{Rules}{Type}
     \RHS{\nt{ValueType} \LISTGRP{\kw{[} \term{Int} \kw{]}}}  
76      \RHS{\kw{image} \kw{(} \term{Int} \kw{)} \nt{Dimensions}}      \RHS{\kw{image} \kw{(} \term{Int} \kw{)} \nt{Dimensions}}
77      \RHS{\kw{field} \kw{\#} \term{Int} \kw{(} \term{Int} \kw{)} \nt{Dimensions}}      \RHS{\kw{field} \kw{\#} \term{Int} \kw{(} \term{Int} \kw{)} \nt{Dimensions}}
78      \RHS{\kw{kernel} \kw{\#} \term{Int}}      \RHS{\kw{kernel} \kw{\#} \term{Int}}
79        \RHS{\nt{ValueType} \LISTGRP{\kw{\{} \term{Int} \kw{\}}}}
80    \end{Rules}}    \end{Rules}}
81  \newcommand{\ValueTypeRULES}{  \newcommand{\ValueTypeRULES}{
82    \begin{Rules}{ValueType}    \begin{Rules}{ValueType}
83      \RHS{\kw{bool}}      \RHS{\kw{tensor} \nt{Dimensions}}
     \RHS{\kw{int}}  
     \RHS{\kw{string}}  
84      \RHS{\kw{real}}      \RHS{\kw{real}}
85      \RHS{\kw{vec2}}      \RHS{\kw{vec2}}
86      \RHS{\kw{vec3}}      \RHS{\kw{vec3}}
87      \RHS{\kw{vec4}}      \RHS{\kw{vec4}}
88      \RHS{\kw{tensor} \nt{Dimensions}}      \RHS{\kw{bool}}
89        \RHS{\kw{int}}
90        \RHS{\kw{string}}
91    \end{Rules}}    \end{Rules}}
92  \newcommand{\DimensionsRULES}{  \newcommand{\DimensionsRULES}{
93    \begin{Rules}{Dimensions}    \begin{Rules}{Dimensions}
94      \RHS{\kw{[} \OPTGRP{\nt{\term{Int}} \LISTGRP{\kw{,} \nt{\term{Int}}}} \kw{]}}      \RHS{\kw{[} \OPTGRP{\term{Int} \LISTGRP{\kw{,} \term{Int}}} \kw{]}}
95    \end{Rules}}    \end{Rules}}
96  \newcommand{\CoordinationDeclRULES}{  \newcommand{\CoordinationDeclRULES}{
97    \begin{Rules}{CoordinationDecl}    \begin{Rules}{CoordinationDecl}
# Line 106  Line 119 
119    \end{Rules}}    \end{Rules}}
120  \newcommand{\ExprRULES}{  \newcommand{\ExprRULES}{
121    \begin{Rules}{Expr}    \begin{Rules}{Expr}
122        \RHS{\nt{OrExpr} \OPTGRP{\kw{if} \nt{Expr} \kw{else} \nt{Expr}}}
123      \end{Rules}}
124    \newcommand{\OrExprRULES}{
125      \begin{Rules}{OrExpr}
126      \RHS{\nt{AndExpr} \LISTGRP{\kw{||} \nt{AndExpr}}}      \RHS{\nt{AndExpr} \LISTGRP{\kw{||} \nt{AndExpr}}}
127    \end{Rules}}    \end{Rules}}
128  \newcommand{\AndExprRULES}{  \newcommand{\AndExprRULES}{
# Line 113  Line 130 
130      \RHS{\nt{CmpExpr} \LISTGRP{\kw{\&\&} \nt{CmpExpr}}}      \RHS{\nt{CmpExpr} \LISTGRP{\kw{\&\&} \nt{CmpExpr}}}
131    \end{Rules}}    \end{Rules}}
132  \newcommand{\CmpExprRULES}{  \newcommand{\CmpExprRULES}{
133    \begin{Rules}{AddExprCmpExpr}    \begin{Rules}{CmpExpr}
134      \RHS{\nt{AddExpr} \LISTGRP{\nt{CmpOp} \nt{AddExpr}}}      \RHS{\nt{AddExpr} \LISTGRP{\nt{CmpOp} \nt{AddExpr}}}
135    \end{Rules}}    \end{Rules}}
136  \newcommand{\AddExprRULES}{  \newcommand{\AddExprRULES}{
# Line 122  Line 139 
139    \end{Rules}}    \end{Rules}}
140  \newcommand{\MulExprRULES}{  \newcommand{\MulExprRULES}{
141    \begin{Rules}{MulExpr}    \begin{Rules}{MulExpr}
142      \RHS{\nt{PrefixExpr} \LISTGRP{\nt{MulOp} \nt{PrefixExpr}}}      \RHS{\nt{PowerExpr} \LISTGRP{\nt{MulOp} \nt{PowerExpr}}}
143      \end{Rules}}
144    \newcommand{\PowerExprRULES}{
145      \begin{Rules}{PowerExpr}
146        \RHS{\nt{ProbeExpr} \LISTGRP{\kw{\^} \nt{ProbeExpr}}}
147      \end{Rules}}
148    \newcommand{\ProbeExprRULES}{
149      \begin{Rules}{ProbeExpr}
150        \RHS{\nt{PrefixExpr} \OPTGRP{\kw{@} \nt{AtomExpr}}}
151    \end{Rules}}    \end{Rules}}
152  \newcommand{\PrefixExprRULES}{  \newcommand{\PrefixExprRULES}{
153    \begin{Rules}{PrefixExpr}    \begin{Rules}{PrefixExpr}
154      \RHS{\nt{SelExpr}}      \RHS{\nt{SuffixExpr}}
155      \RHS{\kw{-} \nt{PrefixExpr}}      \RHS{\kw{-} \nt{PrefixExpr}}
156      \RHS{\kw{!} \nt{PrefixExpr}}      \RHS{\kw{!} \nt{PrefixExpr}}
157      \RHS{\kw{D} \nt{PrefixExpr}}      \RHS{\kw{D} \nt{PrefixExpr}}
158    \end{Rules}}    \end{Rules}}
159  \newcommand{\SelExprRULES}{  \newcommand{\SuffixExprRULES}{
160    \begin{Rules}{SelExpr}    \begin{Rules}{SuffixExpr}
161      \RHS{\nt{AtomExp} \LISTGRP{\kw{@} \nt{AtomExp} $\;|\;$ \kw{[} \nt{Expr} \kw{]}}}      \RHS{\nt{DerivExpr} \LIST{\nt{Suffix}}}
162    \end{Rules}}    \end{Rules}}
163  \newcommand{\AtomExpRULES}{  \newcommand{\SuffixRULES}{
164    \begin{Rules}{AtomExp}    \begin{Rules}{Suffix}
165      \RHS{\term{Id} \OPTGRP{\kw{(} \nt{Arguments} \kw{)}}}      \RHS{\kw{(} \nt{Arguments} \kw{)}}
166        \RHS{\kw{[} \nt{Index} \LISTGRP{\kw{,} \nt{Index}} \kw{]}}
167        \RHS{\kw{\{} Expr \kw{\}}}
168      \end{Rules}}
169    \newcommand{\IndexRULES}{
170      \begin{Rules}{Index}
171        \RHS{\kw{:}}
172        \RHS{\nt{Expr}}
173      \end{Rules}}
174    \newcommand{\DerivExprRULES}{
175      \begin{Rules}{DerivExpr}
176        \RHS{\nt{AtomExpr}}
177        \RHS{\nt{$\mathbf{\nabla}$} \nt{AtomExpr}}
178        \RHS{\nt{$\mathbf{\nabla\otimes}$} \nt{DerivExpr}}
179        \RHS{\nt{$\mathbf{\nabla\times}$} \nt{DerivExpr}}
180        \RHS{\nt{$\mathbf{\nabla\bullet}$} \nt{DerivExpr}}
181      \end{Rules}}
182    \newcommand{\AtomExprRULES}{
183      \begin{Rules}{AtomExpr}
184        \RHS{\term{Id}}
185        \RHS{\kw{identity} \kw{[} \term{Int} \kw{]}}
186        \RHS{\kw{zeros} \nt{Dimensions}}
187      \RHS{\kw{real} \kw{(} \nt{Expr} \kw{)}}      \RHS{\kw{real} \kw{(} \nt{Expr} \kw{)}}
188        \RHS{\kw{(} \nt{Expr} \LISTGRP{\kw{,} \nt{Expr}} \kw{)}}
189        \RHS{\kw{\{} \nt{Expr} \LISTGRP{\kw{,} \nt{Expr}} \kw{\}}}
190      \RHS{\kw{[} \nt{Expr} \LISTGRP{\kw{,} \nt{Expr}} \kw{]}}      \RHS{\kw{[} \nt{Expr} \LISTGRP{\kw{,} \nt{Expr}} \kw{]}}
191      \RHS{\term{Int}}      \RHS{\term{Int}}
192      \RHS{\term{Float}}      \RHS{\term{Float}}
193      \RHS{\term{String}}      \RHS{\term{String}}
     \RHS{\kw{(} \nt{Expr} \LISTGRP{\kw{,} \nt{Expr}} \kw{)}}  
194      \RHS{\kw{|} \nt{Expr} \kw{|}}      \RHS{\kw{|} \nt{Expr} \kw{|}}
195    \end{Rules}}    \end{Rules}}
196  \newcommand{\ArgumentsRULES}{  \newcommand{\ArgumentsRULES}{
# Line 168  Line 215 
215    \begin{Rules}{MulOp}    \begin{Rules}{MulOp}
216      \RHS{\kw{*}}      \RHS{\kw{*}}
217      \RHS{\kw{/}}      \RHS{\kw{/}}
218        \RHS{$\mathbf{\circledast}$}
219        \RHS{$\mathbf{\otimes}$}
220        \RHS{$\mathbf{\bullet}$}
221    \end{Rules}}    \end{Rules}}

Legend:
Removed from v.162  
changed lines
  Added in v.2275

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0