AlanRynne / ifc-syntax-express-parser

A Nearley based parser for EXPRESS language files. Commonly used to define IFC data structure versions.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

IFC Syntax — Express Parser

⚠️ This repo has been deprecated in favour of the new monorepo I created with all my IFC related code. You can check it out at:

IFC Developer Tools

It includes:

  • ifc and express parsers
  • The IFC Syntax VSCode Extension code
  • The IFC Language Server
  • An IFC to Typescript code generator
  • An IFC documentation extraction tool

See you there!!

Parser for EXPRESS files, originally coded to provide type information to the IFC Syntax VSCode extension, also developed by myself.

It uses Nearley.js parser, and a reverse-engineered grammar, since the EXPRESS language has no documentation that I could find.

WARNING: This instructions will be valid once the package is published to npm.

Install

npm install ifc-syntax-express-parser

Usage

Using it is fairly easy, just create a new ExpressParser class instance, and call the parse() function with the path of the file as input.

import { ExpressParser } from 'ifc-syntax-express-parser';

const filePath = './path/to/your/file.exp';
const expressParser = new ExpressParser();
expressParser.parse(filePath).then((schema: IIfcSchema) => {
  // Do whatever you need with the schema entities.
});

Contributing

Contributions are always welcome! Feel free to open Issues or PRs.

About

A Nearley based parser for EXPRESS language files. Commonly used to define IFC data structure versions.

License:MIT License


Languages

Language:Nearley 52.1%Language:TypeScript 46.6%Language:JavaScript 1.3%