Giter VIP home page Giter VIP logo

config-parser-flex's Introduction

config-parser-flex in C

A tiny parser to read content of a own config file using pure c and flex library.

Compile

$ flex myscanner.l
$ cc myscanner.c lex.yy.c 
$ ls
a.out  config.in  lex.yy.c  myscanner.c  myscanner.h  myscanner.l

Using

Run parser and get contents from config.in file via linux/unix command:

$ ./a.out  < config.in 
1
db_type is set to mysql
2
db_name is set to testdata
3
db_table_prefix is set to test_
4
db_port is set to 1099

Similar repositories

Note

You can use %option nounput yylineno in lex file.

TODO

  • Adding fopen() to read yyinput from file
  • Using keyName as value (e.g: db_name : db_name)

Feel free to participate and develop.

Acknowledgment

I saw an lecture from Prof. Jonathan Engelsma and It's encouraged me to do this project myself.

© Copyright Max Base

config-parser-flex's People

Stargazers

 avatar  avatar

Watchers

 avatar  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.