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

SCM Repository

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

Diff of /trunk/doc/report/grammar-defs.tex

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

revision 2635, Mon May 26 14:06:39 2014 UTC revision 2636, Tue May 27 16:18:36 2014 UTC
# Line 6  Line 6 
6  %  %
7  \newcommand{\ProgramRULES}{  \newcommand{\ProgramRULES}{
8    \begin{Rules}{Program}    \begin{Rules}{Program}
9      \RHS{\LISTONE{\nt{Declaration}}}      \RHS{\LIST{\nt{GlobalDecl}} \nt{StrandDecl} \nt{InitialDecl}}
10    \end{Rules}}    \end{Rules}}
11  \newcommand{\DeclarationRULES}{  \newcommand{\GlobalDeclRULES}{
12    \begin{Rules}{Declaration}    \begin{Rules}{Declaration}
     \RHS{\nt{InputDecl}}  
13      \RHS{\nt{VarDecl}}      \RHS{\nt{VarDecl}}
14      \RHS{\nt{StrandDecl}}      \RHS{\nt{InputDecl}}
15      \RHS{\nt{CoordinationDecl}}      \RHS{\nt{FuncDecl}}
16    \end{Rules}}    \end{Rules}}
17  \newcommand{\InputDeclRULES}{  \newcommand{\InputDeclRULES}{
18    \begin{Rules}{InputDecl}    \begin{Rules}{InputDecl}
19      \RHS{\kw{input} \nt{Type} \term{Id} \OPTGRP{\kw{=} \nt{Expr}} \kw{;}}      \RHS{\kw{input} \nt{Type} \term{Id} \OPTGRP{\kw{(} \term{String} \kw{)}} \OPTGRP{\kw{=} \nt{Initializer}} \kw{;}}
20    \end{Rules}}    \end{Rules}}
21  \newcommand{\StrandDeclRULES}{  \newcommand{\FuncDeclRULES}{
22    \begin{Rules}{StrandDecl}    \begin{Rules}{FuncDecl}
23      \RHS{\kw{strand} \term{Id} \kw{(} \nt{Params} \kw{)} \kw{\{} \LISTGRP{\nt{StrandStateDecl}} \LISTONEGRP{\nt{StrandMethod}} \kw{\}}}      \RHS{\kw{function} \nt{Type} \term{Id} \kw{(} \nt{Params} \kw{)} \kw{=} \nt{Expr} \kw{;}}
24        \RHS{\kw{function} \nt{Type} \term{Id} \kw{(} \nt{Params} \kw{)} \nt{Block}}
25    \end{Rules}}    \end{Rules}}
26  \newcommand{\ParamsRULES}{  \newcommand{\ParamsRULES}{
27    \begin{Rules}{Params}    \begin{Rules}{Params}
# Line 31  Line 31 
31    \begin{Rules}{Param}    \begin{Rules}{Param}
32      \RHS{\nt{ValueType} \term{Id}}      \RHS{\nt{ValueType} \term{Id}}
33    \end{Rules}}    \end{Rules}}
34    \newcommand{\StrandDeclRULES}{
35      \begin{Rules}{StrandDecl}
36        \RHS{\kw{strand} \term{Id} \kw{(} \nt{Params} \kw{)} \kw{\{} \LISTGRP{\nt{StrandStateDecl}} \LISTONEGRP{\nt{StrandMethod}} \kw{\}}}
37      \end{Rules}}
38  \newcommand{\StrandStateDeclRULES}{  \newcommand{\StrandStateDeclRULES}{
39    \begin{Rules}{StrandStateDecl}    \begin{Rules}{StrandStateDecl}
40      \RHS{\OPT{\kw{output}} \nt{VarDecl}}      \RHS{\OPT{\kw{output}} \nt{VarDecl}}
# Line 55  Line 59 
59      \RHS{\nt{VarDecl}}      \RHS{\nt{VarDecl}}
60      \RHS{\kw{stabilize} \kw{;}}      \RHS{\kw{stabilize} \kw{;}}
61      \RHS{\kw{die} \kw{;}}      \RHS{\kw{die} \kw{;}}
62        \RHS{\kw{return} \nt{Expr} \kw{;}}
63      \RHS{\kw{new} \term{Id} \kw{(} \nt{Arguments} \kw{)} \kw{;}}      \RHS{\kw{new} \term{Id} \kw{(} \nt{Arguments} \kw{)} \kw{;}}
64      \RHS{\term{Id} \kw{=} \nt{Expr} \kw{;}}      \RHS{\term{Id} \kw{=} \nt{Expr} \kw{;}}
65      \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 86  Line 91 
91    \begin{Rules}{Dimensions}    \begin{Rules}{Dimensions}
92      \RHS{\kw{[} \OPTGRP{\term{Int} \LISTGRP{\kw{,} \term{Int}}} \kw{]}}      \RHS{\kw{[} \OPTGRP{\term{Int} \LISTGRP{\kw{,} \term{Int}}} \kw{]}}
93    \end{Rules}}    \end{Rules}}
94  \newcommand{\CoordinationDeclRULES}{  \newcommand{\InitialDeclRULES}{
95    \begin{Rules}{CoordinationDecl}    \begin{Rules}{InitialDecl}
96      \RHS{\kw{initially} \nt{\GRP{\nt{Array} $\;|\;$ \nt{Collection}}} \kw{;}}      \RHS{\kw{initially} \nt{\GRP{\nt{Array} $\;|\;$ \nt{Collection}}} \kw{;}}
97    \end{Rules}}    \end{Rules}}
98  \newcommand{\ArrayRULES}{  \newcommand{\ArrayRULES}{
# Line 112  Line 117 
117    \end{Rules}}    \end{Rules}}
118  \newcommand{\ExprRULES}{  \newcommand{\ExprRULES}{
119    \begin{Rules}{Expr}    \begin{Rules}{Expr}
120      \RHS{\nt{TestExpr} \OPTGRP{\kw{if} \nt{Expr} \kw{else} \nt{Expr}}}      \RHS{\nt{OrExpr} \OPTGRP{\kw{if} \nt{Expr} \kw{else} \nt{Expr}}}
121    \end{Rules}}    \end{Rules}}
122  \newcommand{\TestExprRULES}{  \newcommand{\OrExprRULES}{
123    \begin{Rules}{TestExpr}    \begin{Rules}{OrExpr}
124      \RHS{\nt{AndExpr} \LISTGRP{\kw{||} \nt{AndExpr}}}      \RHS{\nt{AndExpr} \LISTGRP{\kw{||} \nt{AndExpr}}}
125    \end{Rules}}    \end{Rules}}
126  \newcommand{\AndExprRULES}{  \newcommand{\AndExprRULES}{

Legend:
Removed from v.2635  
changed lines
  Added in v.2636

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