package mopsa

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Copyright (c) 2017-2019 Aymeric Fromherz and The MOPSA Project

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

The definition of the ast can be found at: https://docs.python.org/3/library/ast.html#abstract-grammar

type identifier = string
and stmt = {
  1. skind : stmt_kind;
  2. srange : Mopsa_utils.Location.range;
}
and stmt_kind =
  1. | FunctionDef of identifier * arguments * stmt list * expr list * expr option
  2. | AsyncFunctionDef of identifier * arguments * stmt list * expr list * expr option
  3. | ClassDef of identifier * expr list * keyword list * stmt list * expr list
  4. | Return of expr option
  5. | Delete of expr list
  6. | Assign of expr list * expr
  7. | AugAssign of expr * binop * expr
  8. | AnnAssign of expr * expr * expr option
  9. | For of expr * expr * stmt list * stmt list
  10. | AsyncFor of expr * expr * stmt list * stmt list
  11. | While of expr * stmt list * stmt list
  12. | If of expr * stmt list * stmt list
  13. | With of withitem list * stmt list
  14. | AsyncWith of withitem list * stmt list
  15. | Raise of expr option * expr option
  16. | Try of stmt list * excepthandler list * stmt list * stmt list
  17. | Assert of expr * expr option
  18. | Import of alias list
  19. | ImportFrom of identifier option * alias list * int option
  20. | Global of identifier list
  21. | Nonlocal of identifier list
  22. | Expr of expr
  23. | Pass
  24. | Break
  25. | Continue
and expr = {
  1. ekind : expr_kind;
  2. erange : Mopsa_utils.Location.range;
}
and expr_kind =
  1. | BoolOp of boolop * expr list
  2. | BinOp of expr * binop * expr
  3. | UnaryOp of unop * expr
  4. | Lambda of arguments * expr
  5. | IfExp of expr * expr * expr
  6. | Dict of expr list * expr list
  7. | Set of expr list
  8. | ListComp of expr * comprehension list
  9. | SetComp of expr * comprehension list
  10. | DictComp of expr * expr * comprehension list
  11. | GeneratorExp of expr * comprehension list
  12. | Await of expr
  13. | Yield of expr option
  14. | YieldFrom of expr
  15. | Compare of expr * cmpop list * expr list
  16. | Call of expr * expr list * keyword list
  17. | Num of number
  18. | Str of string
  19. | FormattedValue of expr * int option * expr option
  20. | JoinedStr of expr list
  21. | Bytes of string
  22. | NameConstant of singleton
  23. | Ellipsis
  24. | Attribute of expr * identifier * expr_context
  25. | Subscript of expr * slice * expr_context
  26. | Starred of expr * expr_context
  27. | Name of identifier * expr_context
  28. | List of expr list * expr_context
  29. | Tuple of expr list * expr_context
  30. | Null
and expr_context =
  1. | Load
  2. | Store
  3. | Del
  4. | AugLoad
  5. | AugStore
  6. | Param
and slice =
  1. | Slice of expr option * expr option * expr option
  2. | ExtSlice of slice list
  3. | Index of expr
and boolop =
  1. | And
  2. | Or
and binop =
  1. | Add
  2. | Sub
  3. | Mult
  4. | MatMult
  5. | Div
  6. | Mod
  7. | Pow
  8. | LShift
  9. | RShift
  10. | BitOr
  11. | BitXor
  12. | BitAnd
  13. | FloorDiv
and unop =
  1. | Invert
  2. | Not
  3. | UAdd
  4. | USub
and cmpop =
  1. | Eq
  2. | NotEq
  3. | Lt
  4. | LtE
  5. | Gt
  6. | GtE
  7. | Is
  8. | IsNot
  9. | In
  10. | NotIn
and comprehension = expr * expr * expr list * bool
and excepthandler =
  1. | ExceptHandler of expr option * identifier option * stmt list
and arguments = arg list * arg option * arg list * expr list * arg option * expr list
and arg = identifier * expr option
and keyword = identifier option * expr
and alias = identifier * identifier option
and withitem = expr * expr option
and number =
  1. | Int of Z.t
  2. | Float of float
  3. | Imag of string
and singleton =
  1. | True
  2. | False
  3. | SNone
  4. | SNotImplemented
OCaml

Innovation. Community. Security.