Flexc++ (Version 1.08.00) User Guide

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

University of Groningen

2008-2013

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: Actions

3.6: Startconditions (Miniscanners)

3.6.1: Notation details

3.7: Members

3.8: Handling input your own way

Chapter 4: Generated files

4.1: Multiple input streams

Chapter 5: Pre-loading input lines

5.1: Using mini-scanners to pre-load input lines

5.2: Wrapping input streams

5.2.1: The class ScannerStreambuf
5.2.2: Illustration

Chapter 6: Technical documentation (Mon, 30 Dec 2013 11:22:35 +0000 )

6.1: Notation, Terminology

6.1.0.1: Notations
6.1.0.2: Example patterns with an LA operator

6.2: The parser

6.3: Semantic Data, struct DataType and the class SemUnion

6.3.1: The class Pattern
6.3.2: The class CharClass
6.3.3: The class Interval

6.4: Start Conditions and the class StartConditions

6.5: Code (action) blocks

6.6: The class State

6.7: States

6.8: Rules and the class Rule

6.9: Patterns

6.10: Ranges

6.11: The class TailCount

6.12: The class DFAs

6.13: The DFA

6.13.1: The logic used in 'setTailCount'

6.14: The rows of the DFA: DFAROW

6.15: Patterns using the lookahead operator (LOP)

6.15.1: The LOP handling algorithm
6.15.2: LOP handling: a more extensive example
6.15.3: LOP handling: a problem case
6.15.4: The steps of the LOP handling algorithm

6.16: Final states and ^xyz vs. xyz patterns

6.17: Generating Code

6.17.1: The range-table
6.17.2: The DFAs
6.17.3: The Final-Accept info array

6.18: Run-time operations

6.19: Generating code

6.20: Reflex: refreshing flexc++