Giter Site home page Giter Site logo

mittelmark / yeti Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 0.0 260 KB

Yeti - parser and scanner generator for Tcl

License: BSD 2-Clause "Simplified" License

Tcl 80.18% Roff 7.10% Makefile 0.17% CSS 0.70% HTML 11.84%
parser scanner tcl parser-generator scanner-generator

yeti's Introduction

Yeti - parser and scanner generator for Tcl

This is a fork of the yeti package of Frank Pilhofer. The package has vanished from the internet. See the Tcl Wiki for more details. I added a few bugfixes, removed the tcl++ support and bumpbed the package version to 0.5 to distinguish it clearly from the Frank Pilhofer's version. The Copyright stays at it is, a BSD License. Then the code was backported using a version from Steve Havelka which fixed an issue in yeti.tcl and who removed tcl++ support. So the version is now 0.4.2 - the same which is available in LUCK.

The itcl++ compatible code generation was now removed but you can your self add the catch below your self on top if you need this.

if {[catch {package require Itcl}]} {
    if {[file exists [file join [file dirname [info script]] .. tcl++]]} {
        lappend auto_path [file join [file dirname [info script]] ..]
    } elseif {[file exists [file join [file dirname [info script]] tcl++]]} {
        lappend auto_path [file dirname [info script]]
    }
    package require tcl++
    interp alias {} itcl::class {} tcl++::class
}

The tools yeti and ylex do not work, in contrast to their counterparts taccle and fickle, on straight text files as inputs but on procedure calls, and that it requires Itcl or tcl++ to be present. The advantgage of yeti and ylex is that they can create lexers and parsers on the fly without the need to have this text file processing. Furthermore, yeti and ylex read as input just strings and not file handles.

2021-10-02 - The direct support for tcl++ will be added later if I upload tcl++ version 2.3 and have checked if it still works with Tcl 8.6 and Tcl 8.7.

2021-10-03 - The cutdown version of tcl++ can be already used as alternative to Itcl in the generated scanner or parser if the following lines are used to replace the package require Itcl call on top:

if {[catch {package require Itcl}]} {
    lappend auto_path [file dirname [info script]]
    package require tcl++
    interp alias {} itcl::class {} tcl++::class
    package provide Itcl 3.0
} 

You just have to place the tcl++ folder directly below of your scanner/parser. The scanner should then run even when Itcl is not not available.

Manual pages

Demos

Links

yeti's People

Contributors

mittelmark avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

yeti's Issues

Error encountered using yeti 5.0

Hi Detlef,
when using your version with the files I copied from the page 'Parsing C types' on Tcl's wiki I got the following error:
missing close-brace: possible unbalanced brace in comment
while executing
"itcl::class CParser {"
(file "tmp/cparser.tcl" line 13)
invoked from within
"source tmp/$file.tcl"
("foreach" body line 11)
invoked from within
"foreach {file class} {cscanner CScannerGenerator cparser CParserGenerator} {
if {![file exists tmp/$file.tcl]
|| [file mtime $file.tcl] > [fi..."
(file "driver.tcl" line 221)

Wenn I used my previous version of Yeti the error was gone.
Maybe you can have a look.
Best regards
Helmut
PS: My email address is [email protected]

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.