Skip to content
Snippets Groups Projects
Select Git revision
  • c6e943c40e68df16c36cc62f54c28e77df41c9b0
  • master default
  • labcomm2014
  • labcomm2006
  • python_sig_hash
  • typedefs
  • anders.blomdell
  • typeref
  • pragma
  • compiler-refactoring
  • labcomm2013
  • v2014.6
  • v2015.0
  • v2014.5
  • v2014.4
  • v2006.0
  • v2014.3
  • v2014.2
  • v2014.1
  • v2014.0
  • v2013.0
21 results

LabComm.ast

Blame
  • 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;