Skip to content
Snippets Groups Projects
Select Git revision
  • b99024d4e8bb7503ef2d61bfbd1e7cc4bd6087d4
  • master default
  • labcomm2014_tc31
  • labcomm2014
  • js
  • java_dyn_msg_dec
  • anders.blomdell
  • typeref
  • pragma
  • compiler-refactoring
  • labcomm2013
  • v2014.1
  • v2014.0
  • v2013.0
14 results

LabComm.ast

Blame
  • Forked from Anders Blomdell / LabComm
    274 commits behind the upstream repository.
    Anders Blomdell's avatar
    Anders Blomdell authored
    Conflicts:
    	compiler/C_CodeGen.jrag
    	compiler/LabCommmTokens.jrag
    	compiler/PrettyPrint.jrag
    	compiler/Signature.jrag
    	lib/c/labcomm_decoder.c
    	lib/c/labcomm_private.h
    98cb774e
    History
    LabComm.ast 1.20 KiB
    Program ::= Decl*;
    
    //TODO: Add signatures to the abstract grammar, so that
    //they can be extended and refined by more than one aspect.
    //sketch:
    Signature		::= SignatureList FlatSignatureList:SignatureList; 
    SignatureList		::= SignatureLine*;
    abstract SignatureLine 	::= <Indent:int> <Comment:String>; 
    abstract DataSignatureLine : SignatureLine;
    ByteArraySignatureLine : DataSignatureLine ::= <Data:byte[]>;
    IntSignatureLine : DataSignatureLine ::= <Data:int>;
    StringSignatureLine : DataSignatureLine ::= <Data:String>;
    TypeRefSignatureLine   	: SignatureLine ::= Decl;
    
    
    //abstract Decl ::= Type <Name:String>;
    // the signature list be defined as  a non-terminal attribute:
    abstract Decl ::= Type <Name:String> /Signature/;
    TypeDecl : Decl;
    SampleDecl : Decl;
    
    Field ::= Type <Name:String>;
    
    abstract Type;
    VoidType          : Type;
    SampleRefType     : 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;