dasic 1.1.1

  • README.md
  • Installing
  • Versions
  • 41

Dasic - Dart BASIC interpreter

Dasic is a complete standalone interpreter for a dialect of the original BASIC language. It handles tokenizing, parsing, interpreting, output, variables, expressions, and flow control, like a full-scale compiler or interpreter, just in miniature. I tried to keep the code simple and readable while still being short and readable.

If you've ever wanted a gentle introduction to how a programming languages work under the hood, Dasic is a good place to start.

Sample

Result of dasic packages/dasic/scripts/mandel.das

                                                ----------
                                          ---------++*+++-------
                                      -------------+++*=*=++-------
                                  ---------------++*==@@@=+++---------
                               -------------++++++=*@@@@@@@+++---------
                            ------------+++++++++===@@@@@@==++++++++++---
                         ------------+++**@@@=*@@@@@@@@@@@@@@@@===*====---
                     -------------++++++==*@@@@@@@@@@@@@@@@@@@@@@@@@*+++---
               -----++++++++++++++++++=@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@+++----
        -----------++=====+=*=+++++++*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*+----
    --------------+++++=@@@@@@@@*@===@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@=++-----
  -------------++++++=@@@@@@@@@@@@@@*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*+------
 ------++++++++++=*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@+++------
 --++++=+++=+++@=*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@=++++------
 ---------+++++++=====@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@=++------
   --------------++++===@@@@@@@@@@@==@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@++-----
     -------------++++==@*==*@=@==+==@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*=++----
           --------+++=+++++=++++++++=@*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@==*+----
                  --------------++++++=@=@@@@@@@@@@@@@@@@@@@@@@@@@@*=+++----
                       ------------++++++=@@@@@@@@@@@@@@@@@@@@@@*@@@@=+----
                           -----------++=@*==+=@@@**@@@@@@*=*=@=++++==+---
                              ------------++++++++=@@@@@@@@++++++-------
                                 --------------+++*@*@@@*=@++----------
                                    --------------++++=@=+++---------
                                        -----------++==++++-------
                                             -------=+--------

Install

If you don't have Dart on your machine - Download and install it from here

Install Dasic

    pub global activate dasic

Update Dasic

    # activate dasic again
    pub global activate dasic

Uninstall Dasic

    pub global deactivate dasic   

Usage

Try


    dasic packages/dasic/scripts/hello.das
    dasic packages/dasic/scripts/hellos.das
    dasic packages/dasic/scripts/mandel.das

More Info

The real information about Dasic, including the language syntax and how the interpreter works is all in with the code, so go ahead and read through Dasi.

If you have any questions, feel free to get in touch. Cheers!

Features and bugs

Please file feature requests and bugs at the issue tracker.

Thanks

I want to thank "Bob Nystrom" for his base-work "JASIC"! You can read more from Bob and about "A Complete Interpreter in One Java File" here on his Blog.
Java-Version of Dasic is Jasic

License

Copyright 2015 Michael Mitterer (office@mikemitterer.at),
IT-Consulting and Development Limited, Austrian Branch

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
either express or implied. See the License for the specific language
governing permissions and limitations under the License.

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  dasic: "^1.1.1"

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:dasic/dasic.dart';
        
Version Uploaded Documentation Archive
1.1.1 Nov 16, 2016 Go to the documentation of dasic 1.1.1 Download dasic 1.1.1 archive
1.1.0 Dec 8, 2015 Go to the documentation of dasic 1.1.0 Download dasic 1.1.0 archive
1.0.0 Jun 17, 2015 Go to the documentation of dasic 1.0.0 Download dasic 1.0.0 archive

Analysis

We analyzed this package on Apr 23, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0-dev.49.0
  • pana: 0.10.6

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
0 / 100
Health:
Code health derived from static analysis. [more]
99 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
57 / 100
Overall score:
Weighted score of the above. [more]
41
Learn more about scoring.

Platforms

Detected platforms: Flutter, other

Primary library: package:dasic/dasic.dart with components: io.

Suggestions

  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 12 hints.

    Run dartfmt to format lib/cmdline.dart.

    Run dartfmt to format lib/cmdline/Application.dart.

    Similar analysis of the following files failed:

    • lib/cmdline/Config.dart (hint)
    • lib/cmdline/Options.dart (hint)
    • lib/src/Expression.dart (hint)
    • lib/src/Interpreter.dart (hint)
    • lib/src/Lexer.dart (hint)
    • lib/src/Parser.dart (hint)
    • lib/src/Statement.dart (hint)
    • lib/src/Token.dart (hint)
    • lib/src/Utils.dart (hint)
    • lib/src/Value.dart (hint)
  • Maintain an example.

    Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use dasic.dart.

  • Use analysis_options.yaml.

    Rename old .analysis_options file to analysis_options.yaml.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.8.0 <2.0.0
args ^0.13.0 0.13.7 1.4.2
browser ^0.10.0 0.10.0+3
console_log_handler ^0.2.0 0.2.3 0.5.7
logging ^0.11.0 0.11.3+1
logging_handlers ^0.8.0 0.8.0
validate ^1.0.0 1.6.0
yaml ^2.1.0 2.1.13
Transitive dependencies
charcode 1.1.1
collection 1.14.9
intl 0.15.6
path 1.5.1
source_span 1.4.0
string_scanner 1.0.2
Dev dependencies
grinder any
test any