Reader small image

You're reading from  Network Programming with Rust

Product typeBook
Published inFeb 2018
Reading LevelIntermediate
PublisherPackt
ISBN-139781788624893
Edition1st Edition
Languages
Concepts
Right arrow
Author (1)
Abhishek Chanda
Abhishek Chanda
author image
Abhishek Chanda

Abhishek Chanda studied computer science at IIEST Shibpur in India and electrical engineering at Rutgers University. He has been working on networking and distributed systems since 2008. Over his career, he has worked with large companies (like Microsoft and Dell) and small startups (Cloudscaling, DataSine) in India, US, and the UK. He is enthusiastic about open source software and has contributed to a number of projects like OpenStack, Nomad etc. He contributes to a number of open source projects. He came across Rust in 2015 and found it to be a perfect fit for writing highly performant systems.
Read more about Abhishek Chanda

Right arrow

Parsing textual data

Data parsing is a problem closely related to that of deserialization. The most common way of thinking about parsing is to start with a formal grammar and construct parsers based on that. This results in a bottom-up parser where smaller rules parse smaller components of the whole input. A final combinatorial rule combines all smaller rules in a given order to form the final parser. This way of formally defining a finite set of rules is called a Parsing Expression Grammar (PEG). This ensures that parsing is unambiguous; that there is only one valid parse tree if parsing succeeds. In the Rust ecosystem, there are a few distinct ways of implementing PEGs, and each of those have their own strengths and weaknesses. The first way is using macros to define a domain-specific language for parsing.

This method integrates well with the compiler through the new macro system...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Network Programming with Rust
Published in: Feb 2018Publisher: PacktISBN-13: 9781788624893

Author (1)

author image
Abhishek Chanda

Abhishek Chanda studied computer science at IIEST Shibpur in India and electrical engineering at Rutgers University. He has been working on networking and distributed systems since 2008. Over his career, he has worked with large companies (like Microsoft and Dell) and small startups (Cloudscaling, DataSine) in India, US, and the UK. He is enthusiastic about open source software and has contributed to a number of projects like OpenStack, Nomad etc. He contributes to a number of open source projects. He came across Rust in 2015 and found it to be a perfect fit for writing highly performant systems.
Read more about Abhishek Chanda