Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

README.md

OpenLanguage Documentation

Welcome to the documentation for OpenLanguage, a .NET library for parsing Microsoft Office document languages using GPLEX/GPPG-generated lexers and parsers.

Table of Contents

Core Library Documentation

SpreadsheetML

WordprocessingML

Development

  • Build System - CMake build system with GPPG POSIX yacc parser generation and GPLEX POSIX lex lexer generation
  • Grammar Files - Working with yacc and lex grammar files
  • Testing - Unit test documentation

API Reference

The API reference is generated from XML documentation comments in the source code.

Quick Navigation

Component Description Documentation
Formula Parser SpreadsheetML formula AST parsing Formula.md
Field Instructions WordprocessingML field instruction parsing FieldInstruction.md
MergeField Parser Mail merge field parsing MergeField.md
Expression Parser Expression parsing Expression.md

Project Structure

OpenLanguage consists of:

  • SpreadsheetML.Formula: SpreadsheetML formula parser using GPLEX/GPPG

    • Formula.cs: Main API for parsing formulas into ASTs
    • FormulaParser.cs: Static parser methods
    • Lang/Lex/formula.lex: Lexical grammar for SpreadsheetML formulas
    • Lang/Parse/formula.y: yacc grammar for SpreadsheetML formulas
  • WordprocessingML.FieldInstruction: WordprocessingML field instruction parser

    • FieldInstruction.cs: Core field instruction and argument classes
    • Typed/: Factory and base classes for strongly-typed instructions
    • Parser.cs & Lexer.cs: Parser components
  • Other WordprocessingML Components:

    • MergeField, Expression: Additional lexer components

Build System

The project uses CMake to process .y and .lex files with the C preprocessor (cpp) before compilation. Generated code is placed in the Generated/ directory.

Testing

Unit tests are located in OpenLanguage.Test/ and use xUnit framework. Tests cover:

  • Formula parsing with various combinations of pattern cases
  • Field instruction creation and manipulation
  • Argument type validation
  • AST reconstruction and round-trip testing

Support