A high-performance C++ regex library and lexical analyzer generator with Unicode support. Extends Flex++ with Unicode support, indent/dedent anchors, lazy quantifiers, functions for lex and syntax error reporting and more. Seamlessly integrates with Bison and other parsers.
The following information comes straight from the Bison documentation:
10.1.5.2 C++ location
...
Method on location: void initialize (filename_type* file = nullptr, counter_type line = 1, counter_type col = 1)
Reset the location to an empty range at the given values.
Instance Variable of location: position begin
Instance Variable of location: position end
The first, inclusive, position of the range, and the first beyond.
In other words, the indexing of column numbers is not zero-based and the location type represents an exclusive range. That means that using the reflex's match range directly via matcher().columno() and matcher().columno_end() gives a location the starting position of which is off by one column and also one column too short.
The following information comes straight from the Bison documentation:
In other words, the indexing of column numbers is not zero-based and the
location
type represents an exclusive range. That means that using thereflex
's match range directly viamatcher().columno()
andmatcher().columno_end()
gives alocation
the starting position of which is off by one column and also one column too short.