Giter Site home page Giter Site logo

design-and-implementation-of-a-lexical-and-syntactic-parser's Introduction

Design-and-implementation-of-a-lexical-and-syntactic-parser

💡Lexical parser
1: A lexical analysis program that implements a minimal language for n! and returns a binary as output.
2: Lexical analysis requires the following errors to be reported:
1, illegal characters.
2: colon mismatch.
3: Overflow of identifier length.
Targeted changes can be made to the test program to report the above errors.

💡Syntax parser
1: According to the given method, write the corresponding recursive descending grammar analysis program to implement the grammar check and syntax of the lexical.
The syntax check of the analysed word sequences and the analysis of the program structure, the generation of the corresponding variable list and.
The syntax analysis is based on a given method, which generates a list of variables and a list of procedures, and writes the syntax-checked errors in the compilation to the corresponding files.
2: syntax analysis is reported by specific syntax errors, e.g. missing semicolon, missing right bracket, missing begin, etc;
The syntax analysis requires that all syntax errors are reported as far as possible, and only one error can be reported per line; targeted modifications to the test program are required to check the syntax analyser's error reporting capabilities.

💡Analysis of experimental data and results

image

image

image

image

image

image

image

💡Conclusions of the lexical parser experiment
1: The lexical analyser can correctly report lexical errors and generate the corresponding binary files.
2: This experiment has not yet been carried out for a small number of error functions, and more improvements can be made later
3: Through this experiment, I have designed a simple lexical analyser who has the function of reporting errors, which can be used in practical applications to warn programmers of errors and also improve my programming skills.

💡Conclusion of the grammar parser experiment
1:This experiment has implemented a syntax parser, realised the functions of a syntax parser and gained a deeper understanding of recursive descent analysis.
2:This experiment has achieved most of the functions in syntax error reporting, but there are still some small parts that have not been implemented, so I can continue to improve a little.
3: This experiment is more proficient in the use of C programming methods, but also deepened their understanding of recursive descent analysis.

design-and-implementation-of-a-lexical-and-syntactic-parser's People

Contributors

frannie1020 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.