Coder Social home page Coder Social logo

karol11 / cml Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 0.0 215 KB

A text-based data format. A lightweight replacement of XML, YAML and JSON. It is strictly typed, and it can represent free form data structures.

License: MIT License

Java 31.28% C 50.17% C++ 9.38% Makefile 1.72% JavaScript 6.96% HTML 0.49%

cml's Introduction

CML

CML - is a text-based object representation data format.

Its nearest analogs are YAML, XML and JSON.

The main features that distinguish CML from competitors are:

  • CML stores explicit type information,
  • Its data formats are not limited to tree-like structures, CML can store arbitrary cross-references,
  • CML has simple, obvious and unambiguous syntax ideally suitable both for a human reader and computer parsing.

This repository contains libraries for

  • JavaScript,
  • Java
  • and C that helps both read and write CML files in STAX and DOM modes.

Here is a simple CML example:

Menu.file
caption "File"
items:
  Command.new
  caption "New..."
  hotkey "Ctrl+N"

  Command.open
  caption "Open..."

  Divider

  Submenu.recents
  caption "Recent files"

And here is a more complex example showing all CML features

; this is a comment line
Polygon                        ; <- class name of root object
description "A test polygon"   ; <- a string field
scale 1.5                      ; <- a floating-point number field
visible +                      ; <- a boolean field
pivot Point                    ; <- a field containing a nested object of class Point
  x 100                        ;    <- this nested point has two integer fields x and y
  y 42
points:                        ; <- another field of root polygon containing an array
  Point                        ;    <- array contents - three point objects
  x -10
  y 0

  Point.p1                     ;    <- this is a named object p1
  x 10
  y 10.5
	
  Point
  x 0
  y 0
focused=p1                     ; <- this field is a *reference* to the Point.p1
background# 177                ; <- this field contains binary data
  R0lGODdhGAAgAKIAAAAAAIAAAICAgMDAwP8AAP
  ///wAAAAAAACwAAAAAGAAgAAAEfpDISau9VhTM
  6/hdSAybyBWleaGDuhatOwkkLE8wGd8FnfK6m0
  RnExJ6IOPAZyQIfD/X87O7PafCJVVg4jqXtI+X
  E74KAACzJwk2n9Hn8PYpoVMG8LjblE8L32dVKg
  FTAUpaY1JLAEuGUmlocDJvkX6PlZZSAWiERgIB
  hIIVEQA7

Links

cml's People

Contributors

karol11 avatar

Stargazers

Alexandr Beloborodov avatar Will Angley avatar  avatar

Watchers

 avatar  avatar

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.