NAME

MarpaX::ESLIF::Grammar::Symbol::Properties - ESLIF Grammar Symbol Properties

VERSION

version 3.0.5

SYNOPSIS

use MarpaX::ESLIF;

my $eslif = MarpaX::ESLIF->new();
my $data = do { local $/; <DATA> };
my $eslifGrammar = MarpaX::ESLIF::Grammar->new($eslif, $data);
my $symbolProperties = $eslifGrammar->symbolProperties(0);
my $symbolPropertiesByLevel = $eslifGrammar->symbolPropertiesByLevel(0, 0);

__DATA__
#
# This is an example of a calculator grammar
#
:start   ::= Expression
:default ::=             action        => do_op
                         symbol-action => do_symbol
                         free-action   => do_free     # Supported but useless
:desc    ::= 'Calculator'
:discard ::= whitespaces event  => discard_whitespaces$
:discard ::= comment     event  => discard_comment$

event ^Number = predicted Number
event Number$ = completed Number
Number   ::= NUMBER   action => ::shift

event Expression$ = completed Expression
event ^Expression = predicted Expression
Expression ::=
    Number                                           action => do_int
    | '(' Expression ')'              assoc => group action => ::copy[1]
   ||     Expression '**' Expression  assoc => right
   ||     Expression  '*' Expression
    |     Expression  '/' Expression
   ||     Expression  '+' Expression
    |     Expression  '-' Expression

whitespaces ::= WHITESPACES
comment ::= /(?:(?:(?:\/\/)(?:[^\n]*)(?:\n|\z))|(?:(?:\/\*)(?:(?:[^\*]+|\*(?!\/))*)(?:\*\/)))/u

:lexeme ::= NUMBER pause => before event => ^NUMBER
:lexeme ::= NUMBER pause => after  event => NUMBER$

:desc      ~ 'Calculator Tokens'
NUMBER     ~ /[\d]+/   name => 'NUMBER Lexeme'
WHITESPACES ~ [\s]+    name => 'WHITESPACES Lexeme'

$self->getType

Returns the type, c.f. MarpaX::ESLIF::Symbol::Type

$self->isStart

Returns if this is the start symbol

$self->getStart

Returns if this is the start symbol

Alias to isStart()

$self->isDiscard

Returns if this is the discard symbol

$self->getDiscard

Returns if this is the discard symbol

Alias to isDiscard()

$self->isDiscardRhs

Returns if this is a RHS of a discard rule

$self->isDiscardRhs

Returns if this is a RHS of a discard rule

Alias to isDiscardRhs()

$self->isLhs

Returns if this is an LHS

$self->getLhs

Returns if this is an LHS

Alias to isLhs()

$self->isTop

Returns if this is the first symbol of the grammar

$self->getTop

Returns if this is the first symbol of the grammar

Alias to isTop()

$self->getId

Returns the id

$self->getDescription

Returns the description

$self->getEventBefore

Returns the event before name, null if there is none

$self->isEventBeforeInitialState

Returns if the event before initial state is on, meaningless if there is no event before

$self->getEventBeforeInitialState

Returns if the event before initial state is on, meaningless if there is no event before

Alias to isEventBeforeInitialState()

$self->getEventAfter

Returns the event after name, null if there is none

$self->isEventAfterInitialState

Returns if the event after initial state is on, meaningless if there is no event after

$self->getEventAfterInitialState

Returns if the event after initial state is on, meaningless if there is no event after

Alias to isEventAfterInitialState()

$self->getEventPredicted

Returns the event predicted name, null if there is none

$self->isEventPredictedInitialState

Returns if the event predicted initial state is on, meaningless if there is no prediction event

$self->getEventPredictedInitialState

Returns if the event predicted initial state is on, meaningless if there is no prediction event

Alias to isEventPredictedInitialState()

$self->getEventNulled

Returns the null event name, null if there is none - used internally for ":discard[on]" and ":discard[off]" in particular

$self->isEventNulledInitialState

Returns the nulled event initial state, meaningless if there is nulled event

$self->getEventNulledInitialState

Returns the nulled event initial state, meaningless if there is nulled event

Alias isEventNulledInitialState()

$self->getEventCompleted

Returns the completion event name, null if there is none

$self->isEventCompletedInitialState

Returns the completion event initial state, meaningless if there is no completion event

$self->getEventCompletedInitialState

Returns the completion event initial state, meaningless if there is no completion event

Alias to isEventCompletedInitialState()

$self->getDiscardEvent

Returns the discard event, null if there is none

$self->isDiscardEventInitialState

Returns the discard event initial state, meaningless if there is no discard event

$self->isDiscardEventInitialState

Returns the discard event initial state, meaningless if there is no discard event

Alias to isDiscardEventInitialState()

$self->getLookupResolvedLeveli

Returns the grammar level to which it is resolved, can be different to the grammar used when this is a lexeme

$self->getPriority

Returns the symbol priority

$self->getNullableAction

Returns the nullable action, null if there is none

$self->getPropertyBitSet

Returns the low-level properties (combination of MarpaX::ESLIF::Symbol::PropertyBitSet values)

DESCRIPTION

ESLIF Grammar Symbol Properties.

Calls to grammar's currentSymbolProperties() or symbolPropertiesByLevel() methods outputs an instance of this class.

SEE ALSO

MarpaX::ESLIF::Symbol::Type

1;

AUTHOR

Jean-Damien Durand <jeandamiendurand@free.fr>

COPYRIGHT AND LICENSE

This software is copyright (c) 2017 by Jean-Damien Durand.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.