8000 GitHub - aml-org/syaml: Scala YAML lexer and parser
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

aml-org/syaml

Repository files navigation

SYaml

The SYaml project provides a Pure Scala YAML 1.2 syntax processor that has no dependencies on external libraries.

About

This project includes the following:

Features

In development

  • Java API and libraries
  • JavaScript API and libraries
  • Improve error messages
  • Improve documentation
  • Model golden tests

Usage

Lexer (YEAST Token Output)

The following example shows how to iterate through YEAST tokens:

private def generate(yamlFile: File, yeastFile: File) = {
  val out   = new PrintWriter(yeastFile)
  val lexer = YamlLexer(yamlFile)
  while (lexer.token != YamlToken.EndStream) {
    val data = YeastData(lexer.tokenData, lexer.tokenString)
    out.println(data)
    lexer.advance()
  }
  out.close()
}

Parser (Model Output)

The following example shows how to parse a file:

private def generate(yamlFile: File) = {
  val elements = YamlParser(yamlFile).parse()
  for (e <- elements) {
    println(e)
  }
}

About

Scala YAML lexer and parser

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 22

0