Module parser

Module parser 

Source
Expand description

This module contains the parser for the Cedar language.

Modules§

cst
Concrete Syntax Tree def used as parser first pass
err
error handling utilities
text_to_cst
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§

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

Functions§

parse_euid
parse an EntityUID
parse_expr
parse an Expr
parse_ident
parse an identifier
parse_internal_string
parse a string into an internal Cedar string
parse_literal
parse a string into an ast::Literal (does not support expressions)
parse_name
parse a Name
parse_namespace
Parse a namespace
parse_policy
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_policy_template
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”.
parse_policy_template_to_est_and_ast
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.
parse_policy_to_est_and_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.
parse_policyset
simple main function for parsing policies generates numbered ids
parse_policyset_to_ests_and_pset
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.
parse_request
parse into a Request
parse_restrictedexpr
parse a RestrictedExpr