packages feed

uhc-light-1.1.7.0: 103/lib/ag/Foreign/AbsSyn.ag

DATA ForeignAGItf
  | AGItf           ent             : ForeignEnt

DATA ForeignExprAGItf
  | AGItf           expr            : ForeignExpr

DATA ForeignEnt
  | CCall           ent             : CCall
  | PlainCall       ent             : PlainCall
  | PrimCall        ent             : PrimCall
  | JavaScriptCall  ent             : JavaScriptCall

DATA CCall
  | Id              isStatic        : Bool
                    mbInclude       : {Maybe String}
                    asPointer       : Bool
                    nm              : String
  | Dynamic
  | Wrapper

DATA PrimCall
  | Id              nm              : String
  					mbKnownPrim		: {Maybe KnownPrim}

DATA JavaScriptCall
  | Id              -- argument which acts as receiver object (if any), starting at 1, e.g. for arg 1:
					-- "%1.g", f x y ~> to x.g(y)
  					-- mbThisArgNr		: {Maybe Int}
                    nm              : String

                    -- args which is used as index, e.g. for arg 1:
                    -- "g[%1]"    , f x y ~> g[x](y)
                    -- "&%1.g[%2]", f x y ~> x.g[y]
  					-- mbIndexArgNr	: {Maybe Int}
            		mbInclude     	: {Maybe String}
  					mbForeignExpr	: {Maybe ForeignExpr}
  | Dynamic
  | Wrapper

DATA PlainCall
  | Id              nm              : String

DATA ForeignExpr
  | Call			expr			: ForeignExpr		-- actual call, pasting in remaining arguments
  | CallArgs		expr			: ForeignExpr		-- actual call, explicit use of arguments
  					args			: ForeignExprs
  | Ptr				expr			: ForeignExpr		-- as pointer, or as value, not calling anything
  | Sel				expr			: ForeignExpr		-- select
  					sel				: ForeignExpr
  | Inx				expr			: ForeignExpr		-- index
  					inx				: ForeignExpr
  | Ent													-- the named entity in the FFI spec
  | EntNm			nm				: String			-- explicitly named entity, overriding Ent
  | Arg				nr				: Int				-- an explicitly named arg, which will then not be passed as remaining arg
  | AllArg												-- all (remaining) args
  | Empty												-- nothing
  | Str  			str				: String			-- string constant
  | ObjData                                             -- data export for JS objects
  | NewObj          expr            : ForeignExpr

TYPE ForeignExprs	=	[ForeignExpr]

SET AllForeignExpr	=	ForeignExpr ForeignExprs

SET AllForeign      =   ForeignEnt CCall PlainCall PrimCall JavaScriptCall