Flexc++ (Version 2.15.00) User Guide

Frank B. Brokken, Jean-Paul van Oosten,
and (until 0.5.3) Richard Berendsen

University of Groningen

2008-2024

Table of Contents

Chapter 1: Introduction

1.1: Running Flexc++

1.1.1: Flexc++ options

1.2: Some simple examples

1.2.1: A simple lexer file and main function
1.2.2: An interactive scanner supporting command-line editing

Chapter 2: Differences between flex and flexc++

2.1: Format of the input file

2.1.1: Definition section
2.1.2: Rules section
2.1.3: User code section

2.2: Patterns

2.3: Generated files

2.4: Comment

2.5: Members and macros

2.6: Multiple input streams

Chapter 3: Format of the input file

3.1: Definitions section

3.1.1: Directives

3.2: Rules section

3.3: Comment

3.4: Patterns

3.5: Character constants

3.6: Actions

3.7: Start conditions (Mini scanners)

3.7.1: Notation details

3.8: Members

3.9: Handling input your own way

Chapter 4: Generated files

4.1: Multiple input streams

Chapter 5: Pre-loading input lines

5.1: Using start conditions to pre-load input lines

5.2: Wrapping input streams

5.2.1: The class ScannerStreambuf
5.2.2: Illustration

Chapter 6: Technical documentation

6.1: Notation, Terminology

6.1.1: Example of LOP-patterns

6.2: The parser

6.3: Start Conditions and the class StartConditions

6.4: Code (action) blocks

6.5: The class State

6.6: States

6.7: Rules and the class Rule

6.8: Converting REs to Patterns

6.8.1: The class CharClass
6.8.2: The class Interval

6.9: Patterns

6.10: Patterns using the lookahead operator (LOP)

6.10.1: The parser recognizing LOP patterns
6.10.1.1: Start conditions used by standard LOP patterns
6.10.2: Pattern constructors used with LOP patterns
6.10.3: Adding (LOP-)rules
6.10.4: After parsing: adding LOP start conditions
6.10.5: After parsing: handling LOP rules

6.11: Ranges

6.12: The class DFAs

6.13: The DFA

6.13.1: DFA::build: From NFA to DFA
6.13.2: Removing duplicate rows

6.14: The rows of the DFA: DFAROW

6.14.1: Associating a DFARow with a Rule

6.15: Finding non-viable rules

6.16: Generating Code

6.16.1: The range-table
6.16.2: The DFAs

6.17: Run-time operations

6.17.1: Handling BOL-rules

6.18: Run-time handling of LOP-patterns

6.19: Reflex: refreshing flexc++