https://github.com/exclud/rubyparser
A Parser for Ruby
https://github.com/exclud/rubyparser
c parser ruby rubyparser yacc yacc-lex
Last synced: 7 months ago
JSON representation
A Parser for Ruby
- Host: GitHub
- URL: https://github.com/exclud/rubyparser
- Owner: exclud
- Created: 2023-03-26T22:01:15.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-04-05T06:56:16.000Z (over 2 years ago)
- Last Synced: 2025-01-13T12:27:38.804Z (9 months ago)
- Topics: c, parser, ruby, rubyparser, yacc, yacc-lex
- Language: C
- Homepage:
- Size: 145 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Ruby Parser
This is a fully functioning Parser for Ruby using Yacc. Yacc generates a parser from a grammar file, which defines the rules for your language.
## Features
- Support for arithmetic expressions including addition, subtraction, multiplication, division, and parentheses for grouping.
- Support Integer Values.
- Supports Variables and Assignments.
- Support for String Variables.
## InstallationTo run the parser, you need to install Yacc and Lex:
sudo apt-get install bison flex
In the project directory, run the following commands to Generate lexer and parser:
yacc -d parser.y
lex -o lexer.c lexer.lTo compile the parser and lexer:
gcc -o parser y.tab.c lexer.c -lfl
To test the parser run :
./parser test.txt