Common Text Transformation Library

Web Name: Common Text Transformation Library

WebSite: http://cttl.sourceforge.net

ID:85992

Keywords:

Text,Common,Library,C++,substring,library

Description:

CTTL is a library of C++ classes and functions to parse and modify STL strings. The library is designed to manipulate std::basic_string template class, or a user-defined class with similar interface. The library provides components for creating lexical analyzers making practical use of EBNF grammars. Template meta-programming and operator overloading offer features to write expressions that describe EBNF grammar rules directly in C++. No additional steps of parsing, compiling, or source code preprocessing are required. Compiled CTTL program implements LL(INF)-parser, the recursive-descent parser with infinite lookahead. CTTL lexer generates a stream of substrings that correspond to parsed tokens. Substrings can be compared, inserted, deleted, or replaced without restrictions. CTTL substrings remain stable when content of the underlying string changes. Substring boundaries are adjusted according to the positional shifts of inserted or deleted text. The library formalizes concept of text transformation as a series of mutating operations on substrings, executed in any order. More specifically, text transformation becomes first-hand operation during grammar evaluation. Since EBNF grammar productions are recursive by definition, text-manipulating programs can also be written as recursive algorithms. Common Text Transformation Library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Common Text Transformation Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. CTTL was not conceived as a regex replacement; CTTL was primarily designed as an extension of STL string. Since input pattern matching is essential for a text-processing library, adoption of an existing regular expression engine (or a proprietary regex implementation) was considered to be a viable option. At the same time, since hosting a regex interpreter poses a runtime performance setback, the decision was made in favor of a different solution. CTTL approaches pattern-matching at a procedural level, adopting EBNF metasyntax notation to describe formal grammar productions. The following table compares regex and CTTL within a domain of problems solvable with std::string: Interpreted at runtime. But how well is the expression optimized beyond rudimentary parsing? Sub-expression (backreference) syntax is obscure: "To figure out the number of a particular backreference, scan the regular expression from left to right and count the opening round brackets..." (from www.regular-expressions.info tutorial.) EBNF grammars allow dividing complex expressions into a set of C++ functions that represent individual grammar productions. Method of reporting results of matching sub-expressions is using an old style C-array. Array elements are constant objects. Substrings represent parsed tokens. Substrings are first-hand C++ objects, created by the user. Substrings can be instantly replaced, deleted, or inserted, adding more power to std::string class. Mapping between regex metacharacters and CTTL lexer components is available here. However, the most significant difference between regex and CTTL is in the way of thinking: regex is a terse cipher of special characters, substituted according to a predetermined set of rules. By contrast, CTTL grammars are wordier, more methodical, and recursive by nature. CTTL improves the quality of pattern-matching code without sacrificing performance. GNU GCC Versions 3.2.x, 3.3.x, 3.4.x, 4.1.2 (Red Hat) 4.3.x (MinGW) MSVC 8.0 Version 14.00.50727.762 (2005) MSVC 7.1 Version 13.10.3077 (2003) Comeau C/C++ Version 4.3.3 CTTL manual explains principals of grammar parsing and functionality of substrings. The API documentation includes doxygen generated pages for CTTL distribution includes only C++ headers and sample source files. The library is header-only: the header files contain template classes and functions, which do not require separately-compiled binaries. No installation or other special treatment is needed. Download and enjoy! The sample programs in example/ subdirectory expect that library headers are available in relative subdirectories cttl/, lambda/, and utils/: #include "cttl/cttl.h"#include "lambda/lambda.h"#include "utils/itos.h"// etc. You may need to adjust the include paths in sample programs according to your local directory structure. The library does not require any specific compiler switches or settings; with GNU compiler, your should be able to compile and link your CTTL programs by commands like me@CTTL3 ~/cttl300$ g++ -g -Wall -c -o main.o main.cppme@CTTL3 ~/cttl300$ g++ -o sample.exe main.ome@CTTL3 ~/cttl300 CTTL manual provides rational for various sample programs in example/ subdirectory of CTTL distribution. To find documentation for a particular program, locate its source file name in the index and follow the link: If you would like to financially support CTTL development team, buy a copy of c-jump computer programming board game at http://www.c-jump.com/. The game introduces programming concepts to children and adults with no prior knowledge of the subject. Thank you for your support!

TAGS:Text Common Library C++ substring library

<<< Thank you for your visit >>>

Websites to related :
EPCC Library Catalog

  When searching multiple words the system will automatically suppply the Boolean and operator between each word; multiple words entered for the search

Adams Public Library System -

  Featured Online Collections The Adams Public Library System is a 21st Century Modern Library! In addition to the books in our stacks, historical archi

Williamson Library, TN | Officia

  Our Friends of the Library will be hosting the Book Books! Drive-Thru in the Main Library parking lot on October 31 from 2 to 3:30 in the afternoon. F

Home - Library Homepage - LibGui

  Academic Search Complete Good for finding articles on all subjects. Credo Find background information to start your research. Click the link to brows

Spin Artiste Handspun Yarn For

  What s Been Going On? by The SpinArtiste on March 21, 2017 Oh, my gosh what is been going on?  Where is Spin Artiste???  It s been a bit of a ride i

DigitalCommons@UMaine | The Uni

  DigitalCommons at UMaine provides access to the scholarly, educational, and creative works of the University of Maine community. It is coordinated by

Treasury Services - Virginia Com

  Welcome to VCU Treasury ServicesTreasury Services is responsible for cash management and bank operations, investment management, debt management, cash

Dubuque Carnegie-Stout Library,

  Effective October 5th the Library is open with new expanded hours!Click Here For More Information! TumbleBooks are animated, talking picture books tha

PHI Latin Texts

  not to make copies except for my personal useunder “Fair Use” principles of Copyrightlaw.Click here if you agree to thisLicenseQuestions and comment

LSU Law Digital Commons | Louis

  About the RepositoryLSU Law Digital Commons is the institutional repository of the Louisiana State University Paul M. Hebert Law Center. It aims to pr

ads

Hot Websites