package mopsa
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=37966e98ffeebcedc09bd6e9b2b81f69
sha512=40d4d826c25f680766c07eccbabdf5e8a4fa023016e8a164e4e4f6b3781c8484dc4df437055721dfd19b9db8fb7fe3b61236c4833186d346fc7204a68d01eaaa
doc/mopsa.mopsa_py_parser/Mopsa_py_parser/Cst_to_ast/index.html
Module Mopsa_py_parser.Cst_to_ast
Source
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.
Cst_to_ast - Translates Python CST to a simpler AST.
The AST contains some additional static information, such as:
- global variables,
- functions locals,
- detection of generator functions,
- inlining of packages imports.
But we do not give yet unique IDs to variables.
Main entry point that translates a CST to an AST
val find_scopes_in_block :
Cst.stmt list ->
Cst.identifier list * Cst.identifier list * Cst.identifier list
val find_scopes_in_stmt :
Cst.stmt ->
Cst.identifier list * Cst.identifier list * Cst.identifier list
val (+@) :
(Cst.identifier list * Cst.identifier list * Cst.identifier list) ->
(Cst.identifier list * Cst.identifier list * Cst.identifier list) ->
Cst.identifier list * Cst.identifier list * Cst.identifier list
val (-@) :
Cst.identifier list ->
(Cst.identifier list * Cst.identifier list * Cst.identifier list) ->
Cst.identifier list * Cst.identifier list * Cst.identifier list