From e5d36a8cabe3917c05e8d65a12f521a9a93b258e Mon Sep 17 00:00:00 2001 From: Sven Robertz <sven@cs.lth.se> Date: Fri, 17 May 2013 13:42:57 +0200 Subject: [PATCH] added abstract grammar --- doc/tech_report.tex | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/doc/tech_report.tex b/doc/tech_report.tex index 47dcf5b..d1444c2 100644 --- a/doc/tech_report.tex +++ b/doc/tech_report.tex @@ -253,6 +253,35 @@ way of supporting the common cases is to include run-time checks for overflow in and decoders. \appendix +\section{The LabComm language} +\label{sec:LanguageGrammar} + +\subsection{Abstract syntax} +\begin{verbatim} +Program ::= Decl*; + +abstract Decl ::= Type <Name:String>; +TypeDecl : Decl; +SampleDecl : Decl; + +Field ::= Type <Name:String>; + +abstract Type; +VoidType : Type; +PrimType : Type ::= <Name:String> <Token:int>; +UserType : Type ::= <Name:String>; +StructType : Type ::= Field*; +ParseArrayType : Type ::= Type Dim*; +abstract ArrayType : Type ::= Type Exp*; +VariableArrayType : ArrayType; +FixedArrayType : ArrayType; + +Dim ::= Exp*; + +abstract Exp; +IntegerLiteral : Exp ::= <Value:String>; +VariableSize : Exp; +\end{verbatim} \section{The LabComm protocol} \label{sec:ProtocolGrammar} -- GitLab