Context

NAME

Config::BINDish::Grammar::Context - parsing context representation

DESCRIPTION

Instance of this class represents information about the current parsing context.

ATTRIBUTES

Str:D $.type

The type of the current context. The core grammar knows about block and option contexts. But an extension can define its own type.

$.id

ID of the current context statement, if it has one.

Config::BINDish::Grammar::Value $.keyword

Keyword used to create context. For example, for a block context created with

foo { }

this attribute will be set to a Value where payload attribute is a Match against foo part of the block.

Config::BINDish::Grammar::Value $.name

Name of the current context. Currently can only be set for named block contexts.

Config::BINDish::Grammar::Context $.parent

Parent context. Undefined for .TOP.

Config::BINDish::Grammar::StatementProps $.props

Properties of the context statement if it is pre-declared.

$.relations

A hash of keywords of pre-declared statements which are valid in the current block context. See prop-relations attribute of Config::BINDish::Grammar.

METHODS

cur-block-ctx(--> Config::BINDish::Grammar::Context)

Returns self if current context is a block; or the innermost enclosing block context.

is-TOP()

Returns True if current block context belongs to .TOP.

description()

Returns a string, in a human-readable form, describing the current context.

ACCEPTS(StatementProps:D $props)

Returns True if a pre-declared statement can be used in the enclosing block context.

SEE ALSO

COPYRIGHT

(c) 2023, Vadim Belman <[email protected]>

LICENSE

Artistic License 2.0

See the LICENSE file in this distribution.

Config::BINDish v0.0.18

Extensible BIND9-like Configuration Files Support

Authors

  • Vadim Belman

License

Artistic-2.0

Dependencies

AttrX::Mooish:auth<zef:vrurg>:ver<1.0.0+>:api<1.0.*>IP::AddrTest::Async:auth<zef:vrurg>:ver<0.1.2+>

Test Dependencies

Provides

  • Config::BINDish
  • Config::BINDish::AST
  • Config::BINDish::Actions
  • Config::BINDish::Expandable
  • Config::BINDish::Grammar
  • Config::BINDish::INET
  • Config::BINDish::Ops
  • Config::BINDish::Test
  • Config::BINDish::X

The Camelia image is copyright 2009 by Larry Wall. "Raku" is trademark of the Yet Another Society. All rights reserved.

Built with Podlite โ€” the markup and publishing tools behind this site.