Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Packrat parser
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Operators === {| class="wikitable" |+Syntax Rules !Operator !Semantics |- |Sequence <math>\alpha\beta</math> |'''Success:''' If <math>\alpha</math> and <math>\beta</math> are recognized '''Failure:''' If <math>\alpha</math> or <math>\beta</math> are not recognized '''Consumed:''' <math>\alpha</math> and <math>\beta</math> in case of success |- |Ordered choice <math>\alpha/\beta/\gamma</math> |'''Success:''' If any of <math>\{\alpha,\beta,\gamma\}</math> is recognized starting from the left '''Failure:''' All of <math>\{\alpha,\beta,\gamma\}</math> do not match '''Consumed:''' The atomic expression that has generated a success so if multiple succeed the first one is always returned |- |And predicate <math>\&\alpha</math> |'''Success:''' If <math>\alpha</math> is recognized '''Failure:''' If <math>\alpha</math> is not recognized '''Consumed:''' No input is consumed |- |Not predicate <math>!\alpha</math> |'''Success:''' If <math>\alpha</math> is not recognized '''Failure:''' If <math>\alpha</math> is recognized '''Consumed:''' No input is consumed |- |One or more <math>\alpha +</math> |'''Success:''' Try to recognize <math>\alpha</math> one or multiple time '''Failure:''' If <math>\alpha</math> is not recognized '''Consumed:''' The maximum number that <math>\alpha </math> is recognized |- |Zero or more <math>\alpha *</math> |'''Success:''' Try to recognize <math>\alpha</math> zero or multiple time '''Failure:''' Cannot fail '''Consumed:''' The maximum number that <math>\alpha </math> is recognized |- |Zero or one <math>\alpha ?</math> |'''Success:''' Try to recognize <math>\alpha</math> zero or once '''Failure:''' Cannot fail '''Consumed:''' <math>\alpha</math> if it is recognized |- |Terminal range [<math>a-b</math>] |'''Success:''' Recognize any terminal <math>c</math> that are inside the range <math>[a-b]</math>. In the case of <math> [\textbf{'} h \textbf{'} - \textbf{'} z \textbf{'}] </math>, <math>c</math> can be any letter from h to z '''Failure:''' If no terminal inside of <math>[a-b]</math> can be recognized '''Consumed:''' <math>c</math> if it is recognized |- |Any character <math> . </math> |'''Success:''' Recognize any character in the input '''Failure:''' If no character in the input '''Consumed:''' any character in the input |}
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)