SignalFx SignalFlow language grammar
Project description
This repository contains the SignalFx SignalFlow language grammar and the structure and tools required to generate the public code artifacts that make this grammar available in various languages.
The language is in ANTLR4 format and we use the antlr tool to generate the corresponding source code for the target languages. From there, we can build artifacts that can be included as dependencies in various projects that need to parse SignalFlow programs.
Note: if you’re looking to use the grammar, you should use one of the generated artifacts instead of this repository.
Available languages
Java
The com.signalfx.public:signalflow-grammar artifact Jar is available on Maven Central:
<dependency>
<groupId>com.signalfx.public</groupId>
<artifactId>signalflow-grammar</artifactId>
<version>1.0.0</version>
</dependency>
Javascript
The library is available for npm.js and Bower.
Python
The library is available on PyPI and depends on the Python2 ANTLR runtime:
$ pip install signalflow-grammar
Then, from your code, you can do:
import antlr4
from signalflow.grammar.SignalFlowV2Lexer import SignalFlowV2Lexer
from signalflow.grammar.SignalFlowV2Parser import SignalFlowV2Parser
def parse(program):
lexer = SignalFlowV2Lexer(program)
stream = antlr4.CommonTokenStream(lexer)
parser = SignalFlowV2Parser(stream)
...
Generating or updating the artifacts
Update the generated source code with the generate.sh script:
$ ./generate.sh
+ set -e
+ antlr4 -Dlanguage=Java -package com.signalfx.signalflow.grammar -o java/src/main/java/com/signalfx/signalflow grammar/SignalFlowV2.g4
+ antlr4 -Dlanguage=JavaScript -package signalflow.grammar -o javascript/lib grammar/SignalFlowV2.g4
+ antlr4 -Dlanguage=Python2 -package signalflow.grammar -o python/signalflow grammar/SignalFlowV2.g4
For each language, update the artifact version and perform a release in the appropriate way.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Hashes for signalflow_grammar-1.0.0-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3fa47fe0b44fecd1395b5dbaefa8aad09aac2306433edb63bb253af3af11e1eb |
|
MD5 | 64d03c070cba291e31d6e27a8724dd01 |
|
BLAKE2b-256 | a2855fed2ec5276bab1b18c34c61983abe43cce0ddda35fd2bd95975a7c84fb3 |