Module cedar_policy_core::parser

source ·
Expand description

This module contains the parser for the Cedar language.

Modules§

  • Concrete Syntax Tree def used as parser first pass
  • error handling utilities
  • Step one: Convert text to CST This module contains step one of the parser for the Cedar language. It converts text to a CST

Structs§

  • Metadata for our syntax trees
  • Describes where in policy source code a node in the CST or expression AST occurs.

Functions§

  • parse a string into an internal Cedar string
  • simple main function for parsing a policy. If id is Some, then the resulting policy will have that id. If the id is None, the parser will use “policy0”.
  • Parse a policy or template (either one works) to its EST representation
  • Simple main function for parsing a policy template. If id is Some, then the resulting template will have that id. If the id is None, the parser will use “policy0”.
  • Like parse_policy_template(), but also returns the (lossless) EST – that is, the EST of the original template without any of the lossy transforms involved in converting to AST.
  • Like parse_policy(), but also returns the (lossless) EST – that is, the EST of the original policy without any of the lossy transforms involved in converting to AST.
  • simple main function for parsing policies generates numbered ids
  • Like parse_policyset(), but also returns the (lossless) original text of each individual policy. INVARIANT: The PolicyId of every Policy and Template returned by the policies() and templates() methods on the returned Policy must appear as a key in the returned map.
  • Like parse_policyset(), but also returns the (lossless) ESTs – that is, the ESTs of the original policies without any of the lossy transforms involved in converting to AST.