package edu.neu.ccs.demeter.tools.ridler; import java.util.*; import java.io.*; *public* RIDL = Decls *EOF* . Decls ~{PortalOrFileMarker}. PortalOrFileMarker : Portal | FileMarker. FileMarker = "filename: " FileName. // We should never see an extends in the input! Portal = "portal" ClassName [ Extends] [PortalBody]. Extends = "subclasses" ClassName. PortalBody = "{" MethodList "}". MethodList ~ {Method}. Method = MethodSignature Args ";". Args ~ { Arg}. Arg = ObjectName ":" TransferMode. ObjectName : ParamName | ReturnName. ParamName = ParmName. ReturnName = "return". TransferMode = Mode. Mode : GlobalRef | Copy | NotPassed. GlobalRef = "gref". Copy : FullCopy | TravCopy. FullCopy = "copy". // [ lookahead (@ 2 @) TraversalName]. TravCopy = "copy:" TraversalName. NotPassed = "notpassed". TraversalName = Ident. // Now some visitors et all JavaStrings = JavaType. *noparse* PrintSigV = *extends* PrintVisitor. PrintIntV = *extends* PrintSigV. *parse* Options ~ {Option} *EOF*. Option : Outputdir | FileName. Outputdir = "-outputdir" Word. FileName = BaseName ExtName. ExtName : RidlFile | CDFile. RidlFile = ".ridl". CDFile = ".cd". BaseName = Periodlist(Ident). // All the below is a kludge. Get rid of it List(S) ~ {*s S}. Commalist(S) ~ S {"," *s S}. Periodlist(S) ~ S {"." *s S}. ClassName = Periodlist(Ident). JavaType = Ident. ParmName = Ident {public String toString() (@ return name.toString(); @) public boolean equals(Object o) (@ return (o instanceof ParmName) && (((ParmName) o).get_name().equals(this.get_name())); @) }. MethodName = Ident {public String toString() (@ return name.toString(); @)}. MethodSignature = List(MethodKeyword) JavaType MethodName Paramlist. Paramlist = "(" [ Commalist(MethodParm) ] ")". MethodKeyword : PublicMethod | ProtectedMethod | PrivateMethod | StaticMethod | FinalMethod | AbstractMethod. PublicMethod = "public". ProtectedMethod = "protected". PrivateMethod = "private". FinalMethod = "final". StaticMethod = "static". AbstractMethod = "abstract". MethodParm = JavaType List(ArraySpec) ParmName List(ArraySpec). ArraySpec = "[" "]".