CSS::Specification::Compiler — README

CSS-Specification-Compiler

Synopsis

use CSS::Specification::Compiler;
my CSS::Specification::Compiler $compiler .= new;
use JSON::Fast;
$compiler.load-defs: :file<examples/css21-aural.tsv>;

# output Raku code
mkdir 'lib/MyCSS';

# output main grammar
'lib/MyCSS/Grammar.rakumod'.IO.spurt: .DEPARSE
    given $compiler.build-grammar: <MyCSS Grammar>;

# output a corresponding grammar parse actions class
'lib/MyCSS/Actions.rakumod'.IO.spurt: .DEPARSE
    given $compiler.build-actions: <MyCSS Actions>;

# output stubs for any external rule references
'lib/MyCSS/External.rakumod'.IO.spurt: .DEPARSE
    given $compiler.build-external: <MyCSS External>;

# output associated metadata
mkdir 'resources';
'resources/MyCSSMeta.json'.IO.spurt: $compiler.metadata.&to-json(:sorted-keys);

Description

This module is used to compile sets of CSS property definitions to RakuAST Grammars, Actions, and External references, and to extract Metadata.

CSS::Module, or similar, can then be used to bundle the definitions for use by CSS::Properties and other downstream CSS related modules.

CSS::Specification::Compiler v0.0.2

A RakuAST based compiler for CSS Specification mini-syntax

Authors

  • David Warring

License

Artistic-2.0

Dependencies

CSS::Specification:ver<0.5.2+>

Test Dependencies

Provides

  • CSS::Specification::Compiler
  • CSS::Specification::Compiler::Actions
  • CSS::Specification::Compiler::External
  • CSS::Specification::Compiler::Grammars
  • CSS::Specification::Compiler::Make
  • CSS::Specification::Compiler::Puncuation
  • CSS::Specification::Compiler::Util

Documentation

The Camelia image is copyright 2009 by Larry Wall. "Raku" is a trademark of the Yet Another Society. All rights reserved.

Built with Podlite — the markup and publishing tools behind this site.