
Parse a string into a syntax tree, using 3 + 5 * (7 - 3) to show operators and brackets, with handcrafted parsers or a peg grammar.
Explore how the tokenizers convert a string into tokens for parsing, using Rust iterators, a peekable view, and a Tolkan iterator to emit number and operator tokens.
Parse tokens into a tree by handling brackets, numbers, and operators. Clone token iterators, test for correct bracketed expressions, and build the expression tree with operator precedence.
Build a peg grammar with past, defining whitespace, atomic rules, and operators like plus and star, then test and iterate to verify parsing with bracketed groups.
Convert the peg result to an expression by turning rules into operators, handling numbers and digits, iterating over child rules, mapping to expressions, and safely unwrapping results.
Build a robust error type for a Rust parser system, creating a cargo library and a flexible parser error with unexpected found and optional index, line, and column.
Build a position-tracking iterator for Rust parsers that monitors line and column using utf-8 string indices, implements Iterator, handles newlines, and provides constructors and error handling.
Implement the parser trait in Rust with a pass result type, handle lifetime and error types, and provide function, static string, and character implementations to enable building modular parsers.
Combine simple parsers to build bigger ones by creating tuple parsers and an all method, then use a map to transform parsed results.
this lecture introduces the Kabul trait to validate characters in a string and supports an optional expected method, then builds plus and star parsers to form passes.
Test the parser system by running positive and negative tests, verifying a simple parser with the map combinator that extracts content inside brackets. Explore recursion with a brackets parser, ensure correct results and error handling, and preview building a json parser with gobble in the next chapter.
Explore the gobble parser system in Rust to build a JSON value parser with macros, common utilities, and a recursive value model (bool, int, float, string, array, object).
Build a json string parser by examining the json grammar and implementing escapes and unicode handling. Use Gobble parsers to manage whitespace and extract the final string.
Handle simple types in the adjacent value parser by mapping null and booleans to values, and distinguishing ints from floats by dot, using a Rust library to parse JSON.
Build a value parser for arrays and objects in Rust with Gobble, handling square brackets and map items, and converting them into a hash map with proper error handling.
Test the parser in Rust with Gobble by validating arrays, awkward spacing, and maps, including unicode escapes, newlines, and tabs, using asserts to compare expected structured outputs.
Learn to write parsers efficiently using Rust!
Parsing is an essential part of various computer science disciplines. It helps you to determine the model from the raw representation. Basically, parsing allow you to identify the structure from the given data. With parsing, you can transform data to the extent at which specific software can understand it.
Considering its importance & need, we have curated this online course with which you can learn to write parsers using Rust with Gobble. Rust is a great language for writing parsers with its enums, iterators, and a clear type system . This course will help you understand parsing techniques, how to use parsers, parser library & other crucial things in Rust.
What Makes This Course Unique?
This short online course on writing parsers is a perfect fit for anyone who wants to create parsers in Rust programming. It will first clear all the fundamentals of Parser, then you will learn about the importance of Parser, important techniques,; design decisions, Gobble iterators & so much more. Lastly, upon learning all the essential things, you will create your own parser for a simple programming language.
This Course Includes:
Basics of the parser, its importance, tokenizers
Various approaches to parsing
Understanding the working of Gobble library
Simple expression parser, grammar-based parsing with pest
Building a parser system
Using & cloning iterators to allow backtracking
Techniques for writing your own parser libraries
Taking advantage of Rust optimizers with zero-sized types
A parser project
Get started with this online course to write your Parser using Rust Programming with Gobble!!