Category Archives: Acquarella

New Month’s Resolutions: January 2018

A new year started, and it’s time to write the new month’s resolutions. First, a review of the December’s ones:

– Continue BlockchainJ [complete] see repo
– Continue BlockchainSharp [pending]
– Continue ChineseP [pending]
– Continue TensorSharp [complete] see repo
– Continue Elmie [pending]
– Continue Smartie [complete] see repo
– Continue Evm2Code [complete] see repo
– Continue AprendiendoSolidity [pending]
– Continue AprendiendoMachineLearning [pending]
– Continue Machine Learning Mentorship [pending]
– Prepare another Smart Contracts Programming Course [complete]
– Continue SimpleGo [pending]

I was also working with:

– Continue Yasold [complete] see repo
– Continue RskApi [complete] see repo’
– Improve RskUtils [complete] see repo
– Continue simpleevm [complete] see repo
– Start exeth, Ethereum scripting language [complete] see repo
– Improve SimpleDSL [complete] see repo
– Improve SoliditySamples [complete] see repo
– Improve SolidityCompiler [complete] see repo
– Improve Acquarella [complete] see repo
– Improve smartie [complete] see repo

My January’s resolutions:

– Continue BlockchainJ
– Continue BlockchainSharp
– Continue ChineseP
– Continue TensorSharp
– Continue Elmie
– Continue Smartie
– Continue Evm2Code
– Continue AprendiendoSolidity
– Continue AprendiendoMachineLearning
– Continue Machine Learning Mentorship

Stay tuned!

Angel “Java” Lopez
http://www.ajlopez.com
https://github.com/ajlopez
https://twitter.com/ajlopez

 

 

 

Acquarella Syntax Highlighter

Past weekend, I was coding a simple and configurable syntax highlighter, in C#, named Acquarella. You can see the result at:

https://github.com/ajlopez/Acquarella

The current solution has a class library project, a console program and a test project:

The idea is to have a library you can reference and use from your projects, in case you need some syntax highlighting functionality. The library takes a text (an string) and, giving the source code language and style name, transform it to another text, using configuration files. There is a more detailes information at project README.md.

Dog fooding, the Token.cs class transformed by Acquarella:

namespace Acquarella.Lexers
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;

    public class Token
    {
        private string text;
        private int start;
        private int length;
        private TokenType type;

        public Token(TokenType type, string text, int start, int length)
        {
            this.type = type;
            this.text = text;
            this.start = start;
            this.length = length;
        }

        public string Value
        {
            get
            {
                return this.text.Substring(this.start, this.length);
            }
        }

        public TokenType Type { get { return this.type; } }

        public int Start { get { return this.start; } }

        public int Length { get { return this.length; } }
    }
}

Nice 🙂

Pending work: Recognize comments, more styles (maybe using css files), more language configurations, extending Lexer (maybe RubyLexer, CSharpLexer, etc.)

Keep tuned!

Angel “Java” Lopez

http://www.ajlopez.com

http://twitter.com/ajlopez