Git Product home page Git Product logo

flex's Introduction

Flex

Text file processor.

Sample

IncludeFiles IN//*.*
ExcludeFiles *.jpg *.png *.svg *.mp4
ReadFiles
Edit label text
ReplaceText old_text new_text
ReplaceQuotedText old_quoted_text new_quoted_text
ReplaceUnquotedText old_unquoted_text new_unquoted_text
ReplaceIdentifier old_identifier new_identifier
ReplaceExpression
    old_([A-Z]+)_expression
    new_$1_expression
Edit label
ReplacePrefix prefix_ start_
ReplaceSuffix _suffix _end
Edit folder
ReplacePrefix IN/ OUT/
DumpChangedFiles
DumpChangedLines
WriteFiles

Commands

# comment
IncludeFiles <file path filter> ...
ExcludeFiles [file name filter] ...
SelectFiles [file name filter] ...
IgnoreFiles [file name filter] ...
ReadFiles [file name filter] ...
Edit [folder] [label] [extension] [text]
ListFiles
ListChangedFiles
DumpFiles
DumpChangedFiles
DumpChangedLines [minimum same line count]
WriteFiles
MoveFiles
SetDefinition <definition name> <definition value>
ForEachDefinition <definition name> ... : <definition value> ...
End
AddPrefix <prefix>
RemovePrefix <prefix>
ReplacePrefix <old prefix> <new prefix>
AddSuffix <suffix>
RemoveSuffix <suffix>
ReplaceSuffix <old suffix> <new suffix>
SetText <text>
RemoveText <text>
ReplaceText <old text> <new text>
ReplaceAllTexts <old text> <new text>
RemoveUnquotedText <unquoted text>
RemoveAllUnquotedTexts <unquoted text>
ReplaceUnquotedText <old unquoted text> <new unquoted text>
ReplaceAllUnquotedTexts <old unquoted text> <new unquoted text>
RemoveQuotedText <quoted text>
RemoveAllQuotedTexts <quoted text>
ReplaceQuotedText <old quoted text> <new quoted text>
ReplaceAllQuotedTexts <old quoted text> <new quoted text>
RemoveIdentifier <identifier>
RemoveAllIdentifiers <identifier>
ReplaceIdentifier <old identifier> <new identifier>
ReplaceAllIdentifiers <old identifier> <new identifier>
RemoveExpression <expression>
RemoveAllExpressions <expression>
ReplaceExpression <old expression> <new expression>
ReplaceAllExpressions <old expression> <new expression>
SetLowerCase
SetUpperCase
SetMinorCase
SetMajorCase
SetCamelCase
SetPascalCase
SetSnakeCase
SetKebabCase
SetTitleCase

Special characters

\\ : backslash character
\n : line feed character
\r : carriage return character
\s : space character
\t : tabulation character
\v : void

Installation

Install the DMD 2 compiler (using the MinGW setup option on Windows).

Build the executable with the following command line :

dmd -m64 flex.d

Command line

flex <script file path>

Example

flex script.flex

Version

0.1

Author

Eric Pelzer ([email protected]).

License

This project is licensed under the GNU General Public License version 3.

See the LICENSE.md file for details.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.