package pfff

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type tok = Parse_info.t
type 'a wrap = 'a * tok
type ident = string wrap
type dotted_ident = ident list
type qualifier = dotted_ident
type module_name =
  1. | FileName of string wrap
  2. | DottedName of dotted_ident
type resolved_name =
  1. | Local of gensym
  2. | Param of gensym
  3. | EnclosedVar of gensym
  4. | Global of dotted_ident
  5. | ImportedModule of dotted_ident
  6. | Macro
  7. | EnumConstant
and gensym = int
type name = ident * name_info
and name_info = {
  1. name_qualifier : qualifier option;
  2. name_typeargs : type_arguments option;
}
and id_info = {
  1. id_resolved : resolved_name option ref;
  2. id_type : type_ option ref;
}
and 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 function_definition
  7. | AnonClass of class_definition
  8. | Nop
  9. | Name of name * id_info
  10. | IdSpecial of special wrap
  11. | Call of expr * arguments
  12. | Xml of xml
  13. | Assign of expr * expr
  14. | AssignOp of expr * arithmetic_operator wrap * expr
  15. | LetPattern of pattern * expr
  16. | ObjAccess of expr * ident
  17. | ArrayAccess of expr * expr
  18. | Conditional of expr * expr * expr
  19. | MatchPattern of expr * action list
  20. | Yield of expr
  21. | Await of expr
  22. | Cast of type_ * expr
  23. | Seq of expr list
  24. | Ref of expr
  25. | DeRef of expr
  26. | Ellipses of tok
  27. | OtherExpr of other_expr_operator * any list
and literal =
  1. | Bool of bool wrap
  2. | Int of string wrap
  3. | Float of string wrap
  4. | Char of string wrap
  5. | String of string wrap
  6. | Regexp of string wrap
  7. | Unit of tok
  8. | Null of tok
  9. | Undefined of tok
and container_operator =
  1. | Array
  2. | List
  3. | Set
  4. | Dict
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. | Xor
  18. | Not
  19. | Eq
  20. | NotEq
  21. | PhysEq
  22. | NotPhysEq
  23. | Lt
  24. | LtE
  25. | Gt
  26. | GtE
and incr_decr =
  1. | Incr
  2. | Decr
and prefix_postfix =
  1. | Prefix
  2. | Postfix
and action = pattern * expr
and xml = any list
and arguments = argument list
and argument =
  1. | Arg of expr
  2. | ArgKwd of ident * expr
  3. | ArgType of type_
  4. | ArgOther of other_argument_operator * any list
and other_argument_operator =
  1. | OA_ArgPow
  2. | OA_ArgComp
  3. | OA_ArgQuestion
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_Imag
  13. | OE_Is
  14. | OE_IsNot
  15. | OE_In
  16. | OE_NotIn
  17. | OE_Invert
  18. | OE_Slice
  19. | OE_SliceIndex
  20. | OE_SliceRange
  21. | OE_CompForIf
  22. | OE_CompFor
  23. | OE_CompIf
  24. | OE_CmpOps
  25. | OE_Repr
  26. | OE_NameOrClassType
  27. | OE_ClassLiteral
  28. | OE_NewQualifiedClass
  29. | OE_GetRefLabel
  30. | OE_ArrayInitDesignator
  31. | OE_GccConstructor
  32. | OE_Unpack
  33. | OE_FieldAccessQualified
  34. | OE_RecordWith
  35. | OE_StmtExpr
and stmt =
  1. | ExprStmt of expr
  2. | DefStmt of definition
  3. | DirectiveStmt 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. | OtherStmtWithStmt of other_stmt_with_stmt_operator * expr * stmt
  19. | 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 = ident
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_with_stmt_operator =
  1. | OSWS_With
and other_stmt_operator =
  1. | OS_Delete
  2. | OS_ForOrElse
  3. | OS_WhileOrElse
  4. | OS_TryOrElse
  5. | OS_ThrowFrom
  6. | OS_ThrowNothing
  7. | OS_Global
  8. | OS_NonLocal
  9. | OS_Pass
  10. | OS_Async
  11. | OS_Sync
  12. | OS_Asm
and pattern =
  1. | PatLiteral of literal
  2. | PatConstructor of name * pattern list
  3. | PatRecord of field_pattern list
  4. | PatVar of ident * id_info
  5. | PatTuple of pattern list
  6. | PatList of pattern list
  7. | PatKeyVal of pattern * pattern
  8. | PatUnderscore of tok
  9. | PatDisj of pattern * pattern
  10. | PatTyped of pattern * type_
  11. | PatWhen of pattern * expr
  12. | PatAs of pattern * ident * id_info
  13. | OtherPat of other_pattern_operator * any list
and field_pattern = name * pattern
and other_pattern_operator =
  1. | OP_Expr
  2. | OP_Var
and type_ =
  1. | TyBuiltin of string wrap
  2. | TyFun of type_ list * type_
  3. | TyApply of name * type_arguments
  4. | TyVar of ident
  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. | Mutable
  12. | Const
  13. | Generator
  14. | Async
  15. | Recursive
  16. | MutuallyRecursive
  17. | Ctor
  18. | Dtor
  19. | Getter
  20. | Setter
  21. | Variadic
  22. | NamedAttr of ident * any list
  23. | 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 definition = entity * definition_kind
and entity = {
  1. name : ident;
  2. attrs : attribute list;
  3. type_ : type_ option;
  4. tparams : type_parameter list;
  5. info : id_info;
}
and definition_kind =
  1. | FuncDef of function_definition
  2. | VarDef of variable_definition
  3. | TypeDef of type_definition
  4. | ClassDef of class_definition
  5. | ModuleDef of module_definition
  6. | MacroDef of macro_definition
  7. | Signature of type_
and type_parameter = ident * 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 : ident;
  2. pdefault : expr option;
  3. ptype : type_ option;
  4. pattrs : attribute list;
  5. pinfo : id_info;
}
and other_parameter_operator =
  1. | OPO_KwdParam
  2. | OPO_Ref
and variable_definition = {
  1. vinit : expr option;
  2. vtype : type_ option;
}
and type_definition = {
  1. tbody : type_definition_kind;
}
and type_definition_kind =
  1. | OrType of or_type_element list
  2. | AndType of field list
  3. | AliasType of type_
  4. | Exception of ident * type_ list
  5. | OtherTypeKind of other_type_kind_operator * any list
and or_type_element =
  1. | OrConstructor of ident * type_ list
  2. | OrEnum of ident * expr
  3. | OrUnion of ident * type_
  4. | OtherOr of other_or_type_element_operator * any list
and other_or_type_element_operator =
  1. | OOTEO_EnumWithMethods
  2. | OOTEO_EnumWithArguments
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 other_type_kind_operator =
  1. | OTKO_EnumWithValue
  2. | OTKO_AbstractType
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 module_definition = {
  1. mbody : module_definition_kind;
}
and module_definition_kind =
  1. | ModuleAlias of name
  2. | ModuleStruct of dotted_ident option * item list
  3. | OtherModule of other_module_operator * any list
and other_module_operator =
  1. | OMO_Functor
and macro_definition = {
  1. macroparams : ident list;
  2. macrobody : any list;
}
and directive =
  1. | ImportFrom of module_name * alias list
  2. | ImportAs of module_name * ident option
  3. | OtherDirective of other_directive_operator * any list
and alias = ident * ident option
and other_directive_operator =
  1. | OI_Export
  2. | OI_ImportCss
  3. | OI_ImportEffect
and item =
  1. | IStmt of stmt
  2. | IDef of definition
  3. | IDir of directive
and program = item list
and any =
  1. | Id of ident
  2. | N of name
  3. | En of entity
  4. | E of expr
  5. | S of stmt
  6. | T of type_
  7. | P of pattern
  8. | Def of definition
  9. | Dir of directive
  10. | I of item
  11. | Pa of parameter
  12. | Ar of argument
  13. | At of attribute
  14. | Dk of definition_kind
  15. | Di of dotted_ident
  16. | Fld of field
  17. | Ss of stmt list
  18. | Pr of program
val str_of_name : ('a * 'b) -> 'a
exception Error of string * Parse_info.t
val error : Parse_info.t -> string -> 'a
val gensym_counter : int ref
val gensym : unit -> int
val empty_name_info : name_info
val empty_id_info : unit -> id_info
val basic_param : ident -> parameter_classic
val basic_entity : ident -> attribute list -> entity
val basic_field : ident -> 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.t) option -> string * Parse_info.t
val stmt1 : stmt list -> stmt
val stmt_to_field : stmt -> field
val stmt_to_item : stmt -> item
val is_boolean_operator : arithmetic_operator -> bool
val vardef_to_assign : (entity * variable_definition) -> resolved_name option -> expr
val funcdef_to_lambda : (entity * function_definition) -> resolved_name option -> expr