PEG: Difference between revisions

From Lojban
Jump to navigation Jump to search
mNo edit summary
 
mNo edit summary
Line 1: Line 1:


*''ziryro'i'' amethyst
Parsing Expression grammars.  Parsing expression grammars allow for full lookahead and backtracking in time linear to the input size.  This makes them more expressive than [[jbocre: YACC|YACC]] or [[BNF|BNF]], which are limited in the how far they look ahead, and as a consequence how far they can backtrack.  They also require more memory than either YACC or BNF to parse an equivalently sized input.
*''mijyjbo'' [[jbocre: Middle Lojban|Middle Lojban]]


*''famyma'o'' trailing-cmavo ("terminator")
PEG grammars also do not have a separate lexing stage.  Lexing and parsing are performed at the same time, using the same language for both.
*''datytsani'' Other-Sky ("Dreamtime")


*''teryranmi'' mythos
See wikipedia for additional general information on [http://en.wikipedia.org/wiki/Parsing_expression_grammar arsing Expression Grammars].
*''zasyspo'' temporarily-destroy


*''samymri'' e-mail
==  4th Baseline Machine Grammar Proposal ==
*''lizyzi'e'' the experience of being free


*''ticycfi'' deceiver-flaw
[[jbocre: .alyn.post.|.alyn.post.]] is working on a proposal for a 4th Machine Grammar Baseline, replacing the 3rd baseline's [[jbocre: YACC|YACC]] grammar with a PEG grammar.  This work is scheduled for inclusion into [[jbocre: Suggestions for CLL, second edition LL version 2.0]] or [[jbocre: CLL Peg Errata LL version 2.1]].
*''luryri'e'' lunar river


*''zugygei'' guilt-happy
===  Morphology ===
*''gubybre'' public-ready


*''bevyvau'' carry-container
Since PEG does not have a separate lexing stage, any PEG Machine Grammar will also need to express the Lojban Morphology in PEG.
*''jadydai'' adorn-object


*''zumymlu'' the activity of seeming
* [[BPFK Section: Formal Morphology]]
*''pupypei'' the process of thinking


*''sizyzei'' the idea of crime ("transgression")
===  Technical Points of the PEG language ===
*''dabybai'' fight-compeller


*''noryru'i'' quasi-spirit ("ghost")
* The '.' characters means any character, in any character set.  It is only used after fa'o, which unconditionally consumes the remaining characters.
*''tolyla'a'' unfasten
* '!.' is the way EOF is tested in PEG.


*''tolyla'e'' improbable
* space is defined as the literal '.' (as opposed to the '.' operator of PEG), whitespace, and all punctuation other than ',' and '''.
*''gafyfantytei'' [[jbocre: baseline|baseline]] (a [[jbocre: relylujyjvo|relylujyjvo]])


*''selylacri'' reliable, relied upon
===  CLL ===
*''balylabybu'u'' fine, white cloth (trans. of Hebrew xur in Esther)


*''cucycau'' barefoot (shoe-lacking)
The CLL will need to be updated to account for changes resulting from the translation of the grammar to PEG.


It might be too late to change it now, but I prefer the term za'e zo "cijyjvo".  I would have thought that "lujyjvo" would have had a more relevant/profound seljvo.  -selkik
Main Article: [[jbocre: CLL PEG Errata|CLL PEG Errata]]


Well I'm over feeling like "lujyjvo" is a wasted lujvoWhatever. Leaves us some space for other stuff anyway, like now we can say za'e "lujyjbo" meaning something that's Lojbanically complex or something and it won't conflict as much with "lujyjvo" because they'd have different contextsI still like my word "cijyjvo" though!  I was thinking I could make it more useful by broadening its meaning, for instance to also include words with shapes like "tedjda".  Also I have a question about what's included in lujyjvo: Does it include words with one -CyC- wrinkle but also a non-wrinkled connection, like ummmmm za'e "cintolyla'a"?  I think I'll say those count in the broader category of cijyjvo, but I'm guessing they're not lujyjvo since the only longer lujvo in the list above are relylujyjvo, does that seem right? -selkik
===  Uncategorized Material ===
 
** [[jbocre: Practicable syntax changes|Practicable syntax changes]]
** [[jbocre: Exploiting the preparser|Exploiting the preparser]]
 
*** [[jbocre: rant about "exploiting the preparser"|rant about "exploiting the preparser"]]
 
==  Open Discussion Points ==
 
* jbogenturfa'i further transforms the PEG grammar into an idealized representation.  This parse tree is suitable for programmatic manipulationWhy is this idealized parse tree not the way the PEG is written?
 
== Lojban parsers that use PEG ==
 
* [[jbocre: camxes|camxes]], the original PEG parser from which all others are based.
* [[jbocre: jbogenturfa'i|jbogenturfa'i]]
 
* [[jbocre: jbominje|jbominje]], John Leuner's PEG grammarThe [http://subvert-the-dominant-paradigm.net/~jbominji/code/lojban_grammar.peg ojban_grammar.peg grammar] is derived from camxes.
 
== See Also ==
 
* [http://www.teddyb.org/~rlpowell/hobbies/lojban/grammar/ obin Powell's PEG Grammar Page].  This document builds on the work [[jbocre: camgusmis|camgusmis]] and [[User:xorxes|xorxes]] have done, documented on this page.
* [[jbocre: Grammar|Grammar]], for a discussion of Lojban's grammar beyond PEG.
 
* [[jbocre: YACC|YACC]], the language in which Lojban's official grammar is defined.
* [[BNF|BNF]], widely considered easier to read than the YACC grammar.

Revision as of 17:07, 4 November 2013

Parsing Expression grammars. Parsing expression grammars allow for full lookahead and backtracking in time linear to the input size. This makes them more expressive than YACC or BNF, which are limited in the how far they look ahead, and as a consequence how far they can backtrack. They also require more memory than either YACC or BNF to parse an equivalently sized input.

PEG grammars also do not have a separate lexing stage. Lexing and parsing are performed at the same time, using the same language for both.

See wikipedia for additional general information on arsing Expression Grammars.

4th Baseline Machine Grammar Proposal

.alyn.post. is working on a proposal for a 4th Machine Grammar Baseline, replacing the 3rd baseline's YACC grammar with a PEG grammar. This work is scheduled for inclusion into jbocre: Suggestions for CLL, second edition LL version 2.0 or jbocre: CLL Peg Errata LL version 2.1.

Morphology

Since PEG does not have a separate lexing stage, any PEG Machine Grammar will also need to express the Lojban Morphology in PEG.

Technical Points of the PEG language

  • The '.' characters means any character, in any character set. It is only used after fa'o, which unconditionally consumes the remaining characters.
  • '!.' is the way EOF is tested in PEG.
  • space is defined as the literal '.' (as opposed to the '.' operator of PEG), whitespace, and all punctuation other than ',' and .

CLL

The CLL will need to be updated to account for changes resulting from the translation of the grammar to PEG.

Main Article: CLL PEG Errata

Uncategorized Material

Open Discussion Points

  • jbogenturfa'i further transforms the PEG grammar into an idealized representation. This parse tree is suitable for programmatic manipulation. Why is this idealized parse tree not the way the PEG is written?

Lojban parsers that use PEG

See Also

  • YACC, the language in which Lojban's official grammar is defined.
  • BNF, widely considered easier to read than the YACC grammar.