<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Gustavo Castellanos</title>
    <description>The latest articles on DEV Community by Gustavo Castellanos (@_gusgustavo).</description>
    <link>https://dev.to/_gusgustavo</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F238953%2F2323e333-21c1-4d3c-98e7-fb9f6ea04188.jpg</url>
      <title>DEV Community: Gustavo Castellanos</title>
      <link>https://dev.to/_gusgustavo</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/_gusgustavo"/>
    <language>en</language>
    <item>
      <title>My final report for the GSoC 2020</title>
      <dc:creator>Gustavo Castellanos</dc:creator>
      <pubDate>Mon, 31 Aug 2020 10:51:38 +0000</pubDate>
      <link>https://dev.to/_gusgustavo/my-final-report-for-the-gsoc-2020-167i</link>
      <guid>https://dev.to/_gusgustavo/my-final-report-for-the-gsoc-2020-167i</guid>
      <description>&lt;p&gt;This is my final report for the &lt;a href="https://summerofcode.withgoogle.com/"&gt;Google Summer of Code 2020&lt;/a&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  What is the software?
&lt;/h1&gt;

&lt;p&gt;The software is called Caribay and it is a PEG (Parsing Expression Grammar) Parser Generator built with LpegLabel with support of automatic generation of error labels and error recovery rules. The generated parser captures a generic AST (Abstract Syntactic Tree) or a list of thrown errors. Caribay makes easier to parse lexical symbols, comments, identifiers and keywords using its own syntax. The source code delivered for the GSoC 2020 can be found &lt;a href="https://github.com/gustavoaca1997/Caribay/tree/final-report-gsoc2020"&gt;here on the branch &lt;em&gt;final-report-gsoc2020&lt;/em&gt;&lt;/a&gt;, which is already merged in &lt;em&gt;master&lt;/em&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Basic usage
&lt;/h2&gt;

&lt;p&gt;You need to &lt;em&gt;require&lt;/em&gt; the module &lt;em&gt;caribay.generator&lt;/em&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="kd"&gt;local&lt;/span&gt; &lt;span class="n"&gt;generator&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;require&lt;/span&gt;&lt;span class="s2"&gt;"caribay.generator"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;then you call the &lt;code&gt;gen&lt;/code&gt; function passing a PEG as argument to generate an LPegLabel parser:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="kd"&gt;local&lt;/span&gt; &lt;span class="n"&gt;src&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;[[
    assign &amp;lt;- ID '=' number
    fragment number &amp;lt;- FLOAT / INT
    INT &amp;lt;- %d+
    FLOAT &amp;lt;- %d+ '.' %d+
]]&lt;/span&gt;
&lt;span class="kd"&gt;local&lt;/span&gt; &lt;span class="n"&gt;match&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;generator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;gen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;src&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;match&lt;/span&gt;&lt;span class="s"&gt;[[     a_2     =   3.1416 ]]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Keep reading to learn more about the other features or read the &lt;a href="https://github.com/gustavoaca1997/Caribay/blob/final-report-gsoc2020/README.md"&gt;documentation&lt;/a&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  What I did during GSoC:
&lt;/h1&gt;

&lt;p&gt;The project consisted of developing a parser for the input grammar, a preprocessor for computing some sets (ex.: &lt;em&gt;FIRST&lt;/em&gt; and &lt;em&gt;FOLLOW&lt;/em&gt;), the implementation of an algorithm (with optimizations optionally enabled by the user) for automatically generate the error labels and the translator to LPegLabel patterns.&lt;/p&gt;

&lt;h2&gt;
  
  
  The parser
&lt;/h2&gt;

&lt;p&gt;The parser for the input grammars was built also with LPegLabel. The syntax for the grammars is very similar to the one from the &lt;a href="http://www.inf.puc-rio.br/~roberto/lpeg/re.html"&gt;&lt;strong&gt;re&lt;/strong&gt; module&lt;/a&gt;, but with some new syntax and semantics:&lt;/p&gt;

&lt;h3&gt;
  
  
  Lexical and Syntactic symbols
&lt;/h3&gt;

&lt;p&gt;Caribay differentiates lexical symbols from syntactic symbols as &lt;em&gt;UPPER_CASE&lt;/em&gt; symbols and &lt;em&gt;snake_case&lt;/em&gt; symbols, respectively. The difference is that &lt;strong&gt;lexical symbols&lt;/strong&gt; capture all (and only) the pattern they match as a new AST node, while a &lt;strong&gt;syntactic symbol&lt;/strong&gt; captures a new AST node but with an array with all the children nodes.&lt;/p&gt;

&lt;h3&gt;
  
  
  Predefined symbols
&lt;/h3&gt;

&lt;p&gt;Caribay serves some useful predefined symbols, which are overwritten if the user defines them:&lt;/p&gt;

&lt;h4&gt;
  
  
  SKIP
&lt;/h4&gt;

&lt;p&gt;It is used to skip a pattern between lexical symbols. If the user defines a &lt;code&gt;COMMENT&lt;/code&gt; rule, it becomes part of the ordered choice of &lt;code&gt;SKIP&lt;/code&gt;.&lt;/p&gt;

&lt;h4&gt;
  
  
  ID
&lt;/h4&gt;

&lt;p&gt;The &lt;em&gt;ID&lt;/em&gt; rule is defined by default by this grammar:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ID          &amp;lt;- ID_START ID_END?
ID_START    &amp;lt;- [a-zA-Z]
ID_END      &amp;lt;- [a-zA-Z0-9_]+
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;User can define their own &lt;code&gt;ID_START&lt;/code&gt; and &lt;code&gt;ID_END&lt;/code&gt; rules.&lt;/p&gt;

&lt;h3&gt;
  
  
  Literals
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Regular literals
&lt;/h4&gt;

&lt;p&gt;To match a single literal the user writes the following grammar:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;s &amp;lt;- 'this is a literal'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Captured literals
&lt;/h4&gt;

&lt;p&gt;To also &lt;strong&gt;capture&lt;/strong&gt; the literal's text in a syntactic rule, the user writes it with double quotes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;s &amp;lt;- "a"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The AST captured when matching &lt;em&gt;&lt;code&gt;a&lt;/code&gt;&lt;/em&gt; is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="n"&gt;tag&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'s'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;pos&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
   &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;tag&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'token'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;pos&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'a'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Keywords
&lt;/h4&gt;

&lt;p&gt;Keywords, which are surrounded by backsticks, are a special type of literals: Caribay captures them (when used on syntactic rules) and wraps them around code that ensures they are not confused with identifiers. Basically when matching a keyword &lt;em&gt;kw&lt;/em&gt;, Caribay in reality matches:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;`kw`!ID_END
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and when matching an identifier, Caribay checks that it is not a keyword defined in the grammar.&lt;/p&gt;

&lt;h3&gt;
  
  
  Other features
&lt;/h3&gt;

&lt;p&gt;There are also fragments, semantic actions, named groups, skippable nodes, error labels, and other features.  For reading more about them see the &lt;a href="https://github.com/gustavoaca1997/Caribay/blob/final-report-gsoc2020/README.md"&gt;documentation&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The preprocessor
&lt;/h2&gt;

&lt;p&gt;In the code, this module is called the &lt;em&gt;annotator&lt;/em&gt; and it computes the well known &lt;em&gt;FIRST&lt;/em&gt; and &lt;em&gt;FOLLOW&lt;/em&gt; sets for the symbols and also what I call the &lt;em&gt;LAST&lt;/em&gt; and &lt;em&gt;CONTEXT&lt;/em&gt; sets:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;LAST&lt;/em&gt;: It is the set of possible last tokens or "tails" of the pattern. It is like the opposite of the &lt;em&gt;FIRST&lt;/em&gt; set.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;CONTEXT&lt;/em&gt;: It is the set of tokens that can come before the pattern. It is like the opposite of the &lt;em&gt;FOLLOW&lt;/em&gt; set.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The algorithm
&lt;/h2&gt;

&lt;p&gt;The implemented algorithm is called &lt;em&gt;The Unique Algorithm&lt;/em&gt; and it is based on the research work of my mentor &lt;a href="https://github.com/sqmedeiros"&gt;Sergio Medeiros&lt;/a&gt;. Basically it finds safe places to automatically insert error labels and error recovery rules in the grammar, using &lt;em&gt;FIRST&lt;/em&gt; and &lt;em&gt;FOLLOW&lt;/em&gt; sets. &lt;/p&gt;

&lt;p&gt;An optional optimization for increasing the number of automatically inserted error labels, which I called &lt;em&gt;Unique Context Optimization&lt;/em&gt; and is also based on the research work of Sergio, was implemented using &lt;em&gt;LAST&lt;/em&gt; and &lt;em&gt;CONTEXT&lt;/em&gt; sets.&lt;/p&gt;

&lt;h2&gt;
  
  
  The translator
&lt;/h2&gt;

&lt;p&gt;When running The Algorithm Unique, Caribay translates the grammar to a LPegLabel grammar, generating LPegLabel patterns from the AST nodes returned by the parser.&lt;/p&gt;

&lt;h1&gt;
  
  
  What is missing
&lt;/h1&gt;

&lt;p&gt;There are two pending features:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A way of printing the original grammar but with the new error labels.&lt;/li&gt;
&lt;li&gt;Implement another optimization called &lt;em&gt;Unique Syntactical Symbols&lt;/em&gt; for increasing the number of automatically generated error labels.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Personal Retrospective
&lt;/h1&gt;

&lt;p&gt;First of all, I really enjoyed working on this super-computer-scientific project alongside Sergio, which was very helpful, polite and active answering my questions and suggesting features.&lt;/p&gt;

&lt;p&gt;This was my first time using my knowledge of programming languages theory in a project outside my academic work, but besides this being a summer job, working with Sergio and in this project felt as exciting and rewarding as my favorite academic courses and projects from my university.&lt;/p&gt;

&lt;h1&gt;
  
  
  Acknowledgements
&lt;/h1&gt;

&lt;p&gt;Thanks to Sergio Medeiros for being such a good mentor, to &lt;a href="http://www.lua.inf.puc-rio.br/"&gt;LabLua&lt;/a&gt; for hosting this project and to my buddy &lt;a href="https://dev.to/german1608"&gt;Germán Robayo&lt;/a&gt; for being very motivating about participating in the GSoC (please read his blog!).&lt;/p&gt;

</description>
      <category>gsoc</category>
      <category>lua</category>
      <category>parser</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Application to the GSoC 2020</title>
      <dc:creator>Gustavo Castellanos</dc:creator>
      <pubDate>Thu, 02 Jul 2020 11:32:07 +0000</pubDate>
      <link>https://dev.to/_gusgustavo/application-to-the-gsoc-2020-5356</link>
      <guid>https://dev.to/_gusgustavo/application-to-the-gsoc-2020-5356</guid>
      <description>&lt;h1&gt;
  
  
  Background
&lt;/h1&gt;

&lt;p&gt;Firstly, I am a fan of functional programming since I had to learn Haskell for an interpreter I had to build for a compiler design course at my university. I built that interpreter with &lt;a href="https://dev.to/german1608"&gt;Germán Robayo&lt;/a&gt;, who is also working on a project related to programming languages for the GSoC 2020. You can check his posts about his journey &lt;a href="https://dev.to/german1608/prelude-48a1"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;After taking that course, I decided to take another course where instead of building an interpreter, we had to build a compiler from a programming language designed by us to MIPS32. Funny thing: Since the COVID-19 quarantine, my professor has not had the chance to evaluate our final compiler.&lt;/p&gt;

&lt;h1&gt;
  
  
  Preparation
&lt;/h1&gt;

&lt;p&gt;So with that background, I decided I should participate on a project related to programming languages for the GSoC. As a first step, we the students had to reach out the organizations we would like to work with and choose one of their projects. My little knowledge about Elixir made me write to the Erlang Ecosystem Foundation for working on a syntax highlighter; obviously I also reached out to Haskell.org, but I had no answer. Then I stepped upon LabLua and their project about building a parser generator with automatic error recovery. Until then, the only parser generator I used was &lt;a href="https://www.haskell.org/happy/"&gt;Happy&lt;/a&gt;, which I really loved to use for the projects I already mentioned. So it seemed like a challenge but an interesting one.&lt;/p&gt;

&lt;p&gt;So I reached out to Sérgio Medeiros, the mentor of that project. He is a very nice guy. He told me that I should first get familiar with &lt;a href="https://summerofcode.withgoogle.com/dashboard/"&gt;LPegLabel&lt;/a&gt;, an extended version of the library &lt;a href="http://www.inf.puc-rio.br/~roberto/lpeg/"&gt;LPeg&lt;/a&gt; for building PEG parsers with labeled failures. I had to be familiar with Lua, of course. &lt;/p&gt;

&lt;h2&gt;
  
  
  My first PEG parser
&lt;/h2&gt;

&lt;p&gt;To see if I am capable of working on the parser generator, Sérgio gave me the task of building a parser for the following expression grammar, using LPegLabel:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Program -&amp;gt; (Cmd | Exp)*
Cmd      -&amp;gt; var '=' Exp
Exp       -&amp;gt; Exp '+' Term | Exp '-' Term | Term
Term     -&amp;gt; Term '*' Factor | Term '/' Factor | Factor
Factor   -&amp;gt; num | var | '(' Exp ')'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;He told me that the parser needed error labels to provide better error messages, so I may wanted to read the first 10 pages of &lt;a href="https://arxiv.org/abs/1905.02145"&gt;his paper&lt;/a&gt; about annotating PEGs.&lt;/p&gt;

&lt;p&gt;Before coding, I had to get familiar with Lua. Right then I forgot all the other projects. I started reading the chapters of &lt;a href="https://www.lua.org/pil/contents.html"&gt;Programming in Lua (first edition)&lt;/a&gt; that seemed essential to me for the project. Those were all the &lt;a href="https://www.lua.org/pil/1.html"&gt;Part I&lt;/a&gt;, &lt;a href="https://www.lua.org/pil/11.html"&gt;Part II&lt;/a&gt; excluding metatables (I still don't get them) and some chapters from &lt;a href="https://www.lua.org/pil/18.html"&gt;Part III&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Then I read about Parsing Expression Grammars, but not about their implementations. Maybe I will in the future. And next, I read the documentation of LPeg and LPegLabel.&lt;/p&gt;

&lt;p&gt;Cool, I was ready to start coding. Oh, wait! LPeg does not support left recursions, so first I had to change the grammar and remove any left recursion. This was the resulted grammar:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Program &amp;lt;- (Cmd | Exp)*
Cmd &amp;lt;- var = Exp
Exp &amp;lt;- Term ('+' Term | '-' Term)*
Term &amp;lt;- Factor ('*' Factor | '/' Factor)*
Factor &amp;lt;- var | num | '(' Exp ')'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Coding it with Lua and LPeg was fun! Lua, despite of being really simple, has many high level constructors. Functions are first class citizens, tables are like objects in JavaScript, LPeg defines its own algebraic operations for the patterns (using metatables!!), and many other things were very cool to me.&lt;/p&gt;

&lt;p&gt;Then I inserted some error labels. The approach was the following: If a specific element in a pattern does not match and then the entire matching fails, the parser should throw an error label when that element does not match. Easy to understand, right? If you have any questions about that, let me know in the comments. &lt;/p&gt;

&lt;p&gt;Considering &lt;code&gt;{ErrLabel}&lt;/code&gt; as a syntax for "throwing &lt;code&gt;ErrLabel&lt;/code&gt;", and &lt;code&gt;p^ErrrLabel&lt;/code&gt; as syntax sugar for &lt;code&gt;p | {ErrLabel}&lt;/code&gt;, here is the annotated grammar:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Program &amp;lt;- ( Cmd | Exp | &amp;amp;. {ErrStmt} )*
Cmd     &amp;lt;- var '=' Exp^ErrExp
Exp     &amp;lt;- Term ( ( '+' | '-' ) Term^ErrTerm )*
Term    &amp;lt;- Factor ( ( '*' | '/' ) Factor^ErrFactor )*
Factor  &amp;lt;- var | num | '(' Exp^ErrExp ')'^ErrClosePar
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I wrote some tests using &lt;a href="https://github.com/bluebird75/luaunit"&gt;LuaUnit&lt;/a&gt;. Then I updated them using &lt;a href="//olivinelabs.com/busted/"&gt;Busted&lt;/a&gt;, recommended by Sérgio.&lt;/p&gt;

&lt;p&gt;I shared the parser to Sérgio, he gave me some observations and told me I "passed the test" (he did not say that literally).&lt;/p&gt;

&lt;h1&gt;
  
  
  Proposal
&lt;/h1&gt;

&lt;p&gt;So now I had to write a proposal for the Parser Generator. I read again Sérgio's paper, made some notes, analyzed what I can and cannot do. The paper describes two possible algorithms, one that inserts many labels but may insert some labels wrongly, and another one that inserts few labels but only good ones. I decided to implement the second one.&lt;/p&gt;

&lt;p&gt;I wrote the proposal. Submitted it to the GSoC 2020 site and waited for a response.&lt;/p&gt;

&lt;h1&gt;
  
  
  Approval
&lt;/h1&gt;

&lt;p&gt;One day I went to sleep very late. I woke up in the afternoon. I had an unread message from my girlfriend saying "CONGRATULATIONS", and I was like "wut?". Then I read a group chat I have with some friends, where Germán was giving the news that he got approved and so did I! MY FRIENDS GET THE NEWS BEFORE ME! Anyway, it was a very happy moment. I wrote to Sérgio thanking him for this opportunity. And here I am, still working in the early morning with my parser generator, now called Caribay.&lt;/p&gt;

</description>
      <category>gsoc</category>
      <category>lua</category>
      <category>parser</category>
      <category>opensource</category>
    </item>
    <item>
      <title>My project for GSoC 2020: A Parser Generator with Automatic Error Recovery on LPeg(Label)</title>
      <dc:creator>Gustavo Castellanos</dc:creator>
      <pubDate>Sat, 13 Jun 2020 05:33:32 +0000</pubDate>
      <link>https://dev.to/_gusgustavo/my-project-for-gsoc-2020-a-parser-generator-with-automatic-error-recovery-on-lpeg-label-3o2</link>
      <guid>https://dev.to/_gusgustavo/my-project-for-gsoc-2020-a-parser-generator-with-automatic-error-recovery-on-lpeg-label-3o2</guid>
      <description>&lt;p&gt;This is my first post on DEV and it is the start of a series of posts about my in development proposed project that got approved for the &lt;a href="https://summerofcode.withgoogle.com/"&gt;Google Summer of Code 2020&lt;/a&gt; for the LabLua organization. It consists of a &lt;a href="https://en.wikipedia.org/wiki/Parsing_expression_grammar"&gt;Parsing Expression Grammar&lt;/a&gt; Parser generator, based on the Lua library &lt;a href="https://github.com/sqmedeiros/lpeglabel/"&gt;LPegLabel&lt;/a&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  Summary
&lt;/h1&gt;

&lt;p&gt;The goal is to build a parser generator on top of the library LPegLabel that will automatically support error recovery and (optionally) white spaces around lexical symbols and terminal symbols. We are going to use a conservative algorithm for error labels insertion, hence avoiding insertion on wrong places and no manual intervention from the programmer is needed. If there is enough time, in the end we will improve the number of insertions using information about unique syntactical non-terminal symbols and unique paths to a lexical symbol. During the coding period, some parsers will be generated with the tool as tests and as examples.&lt;/p&gt;

&lt;h1&gt;
  
  
  Source Code
&lt;/h1&gt;

&lt;p&gt;The &lt;strong&gt;source code&lt;/strong&gt; can be found &lt;a href="https://github.com/gustavoaca1997/Caribay"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  Name
&lt;/h1&gt;

&lt;p&gt;The parser generator is called &lt;em&gt;Caribay&lt;/em&gt;, the daughter of Zuhé (the Sun) and Chía (the Moon) from a legend of the Mirripuyes (an indigenous group from Mérida, Venezuela). Since &lt;em&gt;Lua&lt;/em&gt; means "Moon" in Portuguese, the tool being the daughter of Lua sounded nice to me. Also, the legend involves the origin of five famous peaks from Mérida, so the name is related to "generating" things.&lt;/p&gt;

</description>
      <category>gsoc</category>
      <category>lua</category>
      <category>parser</category>
    </item>
  </channel>
</rss>
