pt::util - General utilities
Contents
Api
::pt::utilerror2readableerrortext
This command takes the structured form of a syntax error as thrown by parser runtimes and the
input text to the parser which caused that error and returns a string describing the error in a
human-readable form.
The input text is required to convert the character position of the error into a more readable
line/column format, and to provide excerpts of the input around the error position.
::pt::utilerror2positionerrortext
This command takes the structured form of a syntax error as thrown by parser runtimes and the
input text to the parser which caused that error and returns a 2-element list containing the line
number and column index for the error's character position in the input, in this order.
::pt::utilerror2texterror
This command takes the structured form of a syntax error as thrown by parser runtimes and returns
a list of strings, each describing a possible expected input in a human-readable form.
Bugs, Ideas, Feedback
This document, and the package it describes, will undoubtedly contain bugs and other problems. Please
report such in the category pt of the TcllibTrackers [http://core.tcl.tk/tcllib/reportlist]. Please
also report any ideas for enhancements you may have for either package and/or documentation.
When proposing code changes, please provide unifieddiffs, i.e the output of diff-u.
Note further that attachments are strongly preferred over inlined patches. Attachments can be made by
going to the Edit form of the ticket immediately after its creation, and then using the left-most button
in the secondary navigation bar.
Category
Parsing and Grammars
Copyright
Copyright (c) 2009 Andreas Kupries <andreas_kupries@users.sourceforge.net>
tcllib 1.2 pt::util(3tcl)
Description
Are you lost ? Do you have trouble understanding this document ? In that case please read the overview
provided by the IntroductiontoParserTools. This document is the entrypoint to the whole system the
current package is a part of.
This package provides general utility commands.
This is a supporting package in the Core Layer of Parser Tools.
IMAGE: arch_core_support
Keywords
EBNF, LL(k), PEG, TDPL, context-free languages, expression, grammar, matching, parser, parsing
expression, parsing expression grammar, push down automaton, recursive descent, state, top-down parsing
languages, transducer
Name
pt::util - General utilities
Synopsis
package require Tcl8.59
package require pt::ast?1.2?::pt::utilerror2readableerrortext::pt::utilerror2positionerrortext::pt::utilerror2texterror
________________________________________________________________________________________________________________
