package pfff

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type tok = Parse_info.info
type 'a wrap = 'a * tok
type name = string wrap
type dotted_name = name list
type qualified_name = dotted_name
type module_name =
  1. | FileName of string wrap
  2. | DottedName of dotted_name
type resolved_name =
  1. | Local
  2. | Param
  3. | Global of qualified_name
  4. | NotResolved
  5. | Macro
  6. | EnumConstant
  7. | ImportedModule
type expr =
  1. | L of literal
  2. | Container of container_operator * expr list
  3. | Tuple of expr list
  4. | Record of field list
  5. | Constructor of name * expr list
  6. | Lambda of parameters * stmt
  7. | Nop
  8. | Id of name * id_info
  9. | IdSpecial of special
  10. | Call of expr * arguments
  11. | Assign of expr * expr
  12. | AssignOp of expr * arithmetic_operator * expr
  13. | LetPattern of pattern * expr
  14. | ObjAccess of expr * name
  15. | ArrayAccess of expr * expr
  16. | Conditional of expr * expr * expr
  17. | MatchPattern of expr * action list
  18. | Yield of expr
  19. | Await of expr
  20. | Cast of type_ * expr
  21. | Seq of expr list
  22. | Ref of expr
  23. | DeRef of expr
  24. | Ellipses of tok
  25. | OtherExpr of other_expr_operator * any list
and literal =
  1. | Unit of tok
  2. | Bool of bool wrap
  3. | Int of string wrap
  4. | Float of string wrap
  5. | Char of string wrap
  6. | String of string wrap
  7. | Regexp of string wrap
  8. | Null of tok
  9. | Undefined of tok
and container_operator =
  1. | Array
  2. | List
  3. | Set
  4. | Dict
and id_info = {
  1. id_qualifier : dotted_name option;
  2. id_typeargs : type_arguments option;
  3. id_resolved : resolved_name Stdlib.ref;
  4. id_type : type_ option Stdlib.ref;
}
and special =
  1. | This
  2. | Super
  3. | Self
  4. | Parent
  5. | Eval
  6. | Typeof
  7. | Instanceof
  8. | Sizeof
  9. | New
  10. | Concat
  11. | Spread
  12. | ArithOp of arithmetic_operator
  13. | IncrDecr of incr_decr * prefix_postfix
and arithmetic_operator =
  1. | Plus
  2. | Minus
  3. | Mult
  4. | Div
  5. | Mod
  6. | Pow
  7. | FloorDiv
  8. | LSL
  9. | LSR
  10. | ASR
  11. | BitOr
  12. | BitXor
  13. | BitAnd
  14. | BitNot
  15. | And
  16. | Or
  17. | Not
  18. | Eq
  19. | NotEq
  20. | PhysEq
  21. | NotPhysEq
  22. | Lt
  23. | LtE
  24. | Gt
  25. | GtE
and incr_decr =
  1. | Incr
  2. | Decr
and prefix_postfix =
  1. | Prefix
  2. | Postfix
and arguments = argument list
and argument =
  1. | Arg of expr
  2. | ArgKwd of name * expr
  3. | ArgOther of other_argument_operator * any list
and other_argument_operator =
  1. | OA_ArgPow
  2. | OA_ArgComp
  3. | OA_ArgType
and action = pattern * expr
and other_expr_operator =
  1. | OE_Exports
  2. | OE_Module
  3. | OE_Define
  4. | OE_Arguments
  5. | OE_NewTarget
  6. | OE_Delete
  7. | OE_YieldStar
  8. | OE_Encaps
  9. | OE_Require
  10. | OE_UseStrict
  11. | OE_ObjAccess_PN_Computed
  12. | OE_ExprClass
  13. | OE_Imag
  14. | OE_Is
  15. | OE_IsNot
  16. | OE_In
  17. | OE_NotIn
  18. | OE_Invert
  19. | OE_Slice
  20. | OE_SliceIndex
  21. | OE_SliceRange
  22. | OE_CompForIf
  23. | OE_CompFor
  24. | OE_CompIf
  25. | OE_CmpOps
  26. | OE_Repr
  27. | OE_NameOrClassType
  28. | OE_ClassLiteral
  29. | OE_GetRefLabel
  30. | OE_ArrayInitDesignator
  31. | OE_GccConstructor
  32. | OE_Unpack
and type_ =
  1. | TyBuiltin of string wrap
  2. | TyFun of type_ list * type_
  3. | TyApply of name * type_arguments
  4. | TyVar of name
  5. | TyArray of expr option * type_
  6. | TyPointer of type_
  7. | TyTuple of type_ list
  8. | TyQuestion of type_
  9. | OtherType of other_type_operator * any list
and type_arguments = type_argument list
and type_argument =
  1. | TypeArg of type_
  2. | OtherTypeArg of other_type_argument_operator * any list
and other_type_argument_operator =
  1. | OTA_Question
and other_type_operator =
  1. | OT_Expr
  2. | OT_Arg
  3. | OT_StructName
  4. | OT_UnionName
  5. | OT_EnumName
  6. | OT_Shape
  7. | OT_Variadic
and attribute =
  1. | Static
  2. | Volatile
  3. | Extern
  4. | Public
  5. | Private
  6. | Protected
  7. | Abstract
  8. | Final
  9. | Var
  10. | Let
  11. | Const
  12. | Generator
  13. | Async
  14. | Ctor
  15. | Dtor
  16. | Getter
  17. | Setter
  18. | Variadic
  19. | NamedAttr of name * any list
  20. | OtherAttribute of other_attribute_operator * any list
and other_attribute_operator =
  1. | OA_StrictFP
  2. | OA_Transient
  3. | OA_Synchronized
  4. | OA_Native
  5. | OA_AnnotJavaOther
  6. | OA_AnnotThrow
  7. | OA_Expr
and stmt =
  1. | ExprStmt of expr
  2. | LocalDef of definition
  3. | LocalDirective of directive
  4. | Block of stmt list
  5. | If of expr * stmt * stmt
  6. | While of expr * stmt
  7. | DoWhile of stmt * expr
  8. | For of for_header * stmt
  9. | Switch of expr * case_and_body list
  10. | Return of expr
  11. | Continue of expr option
  12. | Break of expr option
  13. | Label of label * stmt
  14. | Goto of label
  15. | Throw of expr
  16. | Try of stmt * catch list * finally option
  17. | Assert of expr * expr option
  18. | OtherStmt of other_stmt_operator * any list
and case_and_body = case list * stmt
and case =
  1. | Case of expr
  2. | Default
and catch = pattern * stmt
and finally = stmt
and label = name
and for_header =
  1. | ForClassic of for_var_or_expr list * expr * expr
  2. | ForEach of pattern * expr
and for_var_or_expr =
  1. | ForInitVar of entity * variable_definition
  2. | ForInitExpr of expr
and other_stmt_operator =
  1. | OS_Delete
  2. | OS_ForOrElse
  3. | OS_WhileOrElse
  4. | OS_TryOrElse
  5. | OS_With
  6. | OS_ThrowFrom
  7. | OS_ThrowNothing
  8. | OS_Global
  9. | OS_NonLocal
  10. | OS_Pass
  11. | OS_Async
  12. | OS_Sync
  13. | OS_Asm
and pattern =
  1. | PatVar of name
  2. | PatLiteral of literal
  3. | PatConstructor of name * pattern list
  4. | PatTuple of pattern list
  5. | PatList of pattern list
  6. | PatKeyVal of pattern * pattern
  7. | PatUnderscore of tok
  8. | PatDisj of pattern * pattern
  9. | PatTyped of pattern * type_
  10. | OtherPat of other_pattern_operator * any list
and other_pattern_operator =
  1. | OP_Expr
  2. | OP_Var
and definition = entity * definition_kind
and entity = {
  1. name : name;
  2. attrs : attribute list;
  3. type_ : type_ option;
  4. tparams : type_parameter list;
}
and definition_kind =
  1. | FuncDef of function_definition
  2. | VarDef of variable_definition
  3. | ClassDef of class_definition
  4. | TypeDef of type_definition
and type_parameter = name * type_parameter_constraints
and type_parameter_constraints = type_parameter_constraint list
and type_parameter_constraint =
  1. | Extends of type_
and function_definition = {
  1. fparams : parameters;
  2. frettype : type_ option;
  3. fbody : stmt;
}
and parameters = parameter list
and parameter =
  1. | ParamClassic of parameter_classic
  2. | ParamPattern of pattern
  3. | OtherParam of other_parameter_operator * any list
and parameter_classic = {
  1. pname : name;
  2. pdefault : expr option;
  3. ptype : type_ option;
  4. pattrs : attribute list;
}
and other_parameter_operator =
  1. | OPO_KwdParam
  2. | OPO_Ref
and variable_definition = {
  1. vinit : expr option;
  2. vtype : type_ option;
}
and field =
  1. | FieldVar of entity * variable_definition
  2. | FieldMethod of entity * function_definition
  3. | FieldDynamic of expr * attribute list * expr
  4. | FieldSpread of expr
  5. | FieldStmt of stmt
and type_definition =
  1. | OrType of or_type_element list
  2. | AndType of field list
  3. | AliasType of type_
  4. | OtherTypeKind of other_type_kind_operator * any list
and other_type_kind_operator =
  1. | OTKO_EnumWithValue
and or_type_element =
  1. | OrConstructor of name * type_ list
  2. | OrEnum of name * expr
  3. | OrUnion of name * type_
and class_definition = {
  1. ckind : class_kind;
  2. cextends : type_ list;
  3. cimplements : type_ list;
  4. cbody : field list;
}
and class_kind =
  1. | Class
  2. | Interface
  3. | Trait
and directive =
  1. | Import of module_name * alias list
  2. | ImportAll of module_name * name option
  3. | OtherDirective of other_directive_operator * any list
and alias = name * name option
and other_directive_operator =
  1. | OI_Export
  2. | OI_ImportCss
  3. | OI_ImportEffect
  4. | OI_Package
  5. | OI_Define
  6. | OI_Macro
  7. | OI_Prototype
  8. | OI_Namespace
and item =
  1. | IStmt of stmt
  2. | IDef of definition
  3. | IDir of directive
and program = item list
and any =
  1. | N of name
  2. | En of entity
  3. | E of expr
  4. | S of stmt
  5. | T of type_
  6. | P of pattern
  7. | D of definition
  8. | Di of directive
  9. | I of item
  10. | Pa of parameter
  11. | Ar of argument
  12. | At of attribute
  13. | Dk of definition_kind
  14. | Dn of dotted_name
  15. | Pr of program
val str_of_name : ('a * 'b) -> 'a
val empty_info : unit -> id_info
val basic_param : name -> parameter_classic
val basic_entity : name -> attribute list -> entity
val basic_field : name -> type_ option -> field
val empty_var : unit -> variable_definition
val expr_to_arg : expr -> argument
val entity_to_param : entity -> parameter_classic
val opt_to_nop : expr option -> expr
val opt_to_name : (string * Parse_info.info) option -> string * Parse_info.info
val stmt1 : stmt list -> stmt
val stmt_to_field : stmt -> field
val stmt_to_item : stmt -> item
OCaml

Innovation. Community. Security.