GithubHelp home page GithubHelp logo

kenwebb / xholon Goto Github PK

View Code? Open in Web Editor NEW
4.0 3.0 0.0 20.6 MB

Home Page: http://www.primordion.com/Xholon/gwt/

License: Other

Java 36.30% JavaScript 39.64% HTML 20.26% Gnuplot 0.01% CSS 0.31% XSLT 2.94% Shell 0.04% XQuery 0.01% Groovy 0.01% Batchfile 0.04% PHP 0.01% ANTLR 0.20% TeX 0.07% Game Maker Language 0.02% CoffeeScript 0.02% Haskell 0.04% Nearley 0.03% Futhark 0.06%

xholon's Introduction

Xholon

Xholon is an open-source library for making open-ended HTML5 client-side applications. The technology focus is on hierarchical and graph structure, building complex worlds, dynamic interactions, visualization, dynamic content updates, ...

Xholon uses Google Web Toolkit (GWT 2.8.2) to compile this repository's Java source code into a 100%-JavaScript library. The JavaScript API (with a jQuery-like syntax) enables writing web applications that run entirely in the browser.

Some of the numerous sample apps were written in Java, and some exist as XML and JavaScript Xholon Workbooks available as individual gist files. All of these apps run entirely in the browser with no ongoing need for a server.

Xholon is an online environment for exploring and playing around with things as diverse as the structure of a biological cell and the movements of characters in Lord of the Rings. Start by jotting down a few notes, progress to working out what the domain objects are and how they interact, and make it rock by writing some code.

It's all based on the idea that everything is connected. This makes Xholon difficult to describe, because there are so many ways that things can be connected. The best way to start learning is with the sample apps.

Hello World sample app

View the source code and run it, and then make a small edit in the source code and run it again.

View the source code and run it, and then make a small edit in the source code and run it again.

Other Links

Original Xholon site

Original Xholon wiki

Original Xholon Sourceforge project

Xholon Collaborative apps blog

Primordion site

Some apps where graphics are especially important

Interactive animations using d3 circle packing

xholon's People

Contributors

kenwebb avatar

Stargazers

javier abanses avatar Daniel Brookshier avatar Jeremy Douglass avatar  avatar

Watchers

Daniel Brookshier avatar Jeremy Douglass avatar  avatar

xholon's Issues

JavaScript ANTLR4 grammar - Issues with quotes and comments

Hi,

I have downloaded the ANTLR4 grammar from:

https://www.opencypher.org/resources
https://s3.amazonaws.com/artifacts.opencypher.org/M14/Cypher.g4

I am able to process Cypher.g4 (JavaScript):

java -jar antlr-4.7-complete.jar -Dlanguage=JavaScript Cypher.g4

Antlr correctly generates five files:

 CypherLexer.js
 CypherLexer.tokens
 CypherListener.js
 CypherParser.js
 Cypher.tokens

My example web page (.html) includes the following JavaScript code:

  const antlr4 = require('xholon/lib/antlr4/index');
  const CypherLexer = require('xholon/lib/antlr4g/CypherLexer');
  const CypherParser = require('xholon/lib/antlr4g/CypherParser');
  const CypherListener = require('xholon/lib/antlr4g/CypherListener');
  const input = 'CREATE (fgh {ijk: 123.4})'; // OK
  const chars = new antlr4.InputStream(input);
  const lexer = new CypherLexer.CypherLexer(chars);
  const tokens  = new antlr4.CommonTokenStream(lexer);
  const parser = new CypherParser.CypherParser(tokens);
  const tree = parser.oC_Cypher();
  updateTree(tree); // this is where I run my own code

In this simple example CREATE (fgh {ijk: 123.4}), I then process the Cypher tree and get the results that I expect (it creates a new node in my application).

BUT, it fails to work with any Cypher statement that contains single quotes (ex: 'abc'), double quotes (ex: "def"), or comments (ex: // this is a comment). For example:

const input = "CREATE (fgh {ijk: 'This is some text.'})"; // error

or

const input = 'CREATE (fgh {ijk: "This is some text."})'; // error

ErrorListener.js (part of the ANTLR4 distribution) reports (in the browser console window):

line 1:18 token recognition error at: ''Th'
line 1:37 token recognition error at: ''}'
line 1:21 no viable alternative at input 'CREATE (fgh {ijk: is'

I have developed a temporary work-around by replacing content in Cypher.g4 with content from DOT.g4 (Graphviz dot language), which is included with the ANTLR4 distribution.
This lets me handle comments and double-quotes in openCypher, and allows me to continue exploring whether or not I will be able to use openCypher.

I hope this description of the issues I have found will be helpful,
Ken Webb

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.