GithubHelp home page GithubHelp logo

mishurov / rib_lexer_parser Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 33 KB

Lexer and parser for Pixar Renderman RIB files

License: Apache License 2.0

CMake 5.26% C++ 71.26% Lex 6.43% Yacc 14.38% C 2.67%

rib_lexer_parser's Introduction

RIB lexer & parser

A lexer and a parser for Pixar RenderMan RIB files made with Flex and Bison. It doesn't cover the whole grammar only some geometry: quadric surfaces and points general polygons. It can be extended but I don't need it right now. I made it as a boilerplate for building custom parsers with Flex and Bison in C++.

ScreenShot1

Info

Visualisation for the parser is implemented as a Maya locator node and uses Viewport 2.0 API. The quadrics are drawn as point clouds: uniformly sampled points along the parameters of the functions since it's the simplest way to visualise the parsed geometry.

The parser returns a syntax tree which is actually a scene tree and the visualiser traverses the tree using a depth first search and an auxiliary stack for the nested transformations. The parser will fail to parse a file if it encounters some unknown tokens or sequences of the tokens not covered in parser's rules, it's only tested with the files in the directory "samples".

The functions for computing point locations for the quadrics are based on these formulas:
https://web.cs.wpi.edu/~matt/courses/cs563/talks/renderman/quadric.html

rib_lexer_parser's People

Contributors

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