Skip to main content
SignalFlow language grammar
===========================

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:

.. code:: xml

<dependency>
<groupId>com.signalfx.public</groupId>
<artifactId>signalflow-grammar</artifactId>
<version>2.12.0</version>
</dependency>

Javascript
~~~~~~~~~~

The library is available for npm.js, and as a standalone browserified Javascript bundle.

Node.js
^^^^^^^

.. code::

npm install -g signalflow-grammar.js

In browser
^^^^^^^^^^

.. code:: html

<script type="text/javascript" src="https://s3.amazonaws.com/public-sites--signalfx-com/cdn/signalflow-grammar-2.7.0.js"></script>

Python
~~~~~~

The library is available on PyPI and depends on the Python2 ANTLR runtime:

.. code::

$ pip install signalflow-grammar==2.7.0

Then, from your code, you can do:

.. code:: python

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
------------------------------------

Due to the Python like nature of SignalFlow some native code is
required to keep track of indent/dedent levels. This native code
is stored in <language>/grammar/*.g4. These native code files are
stitched into SignalFlowLexer.g4 by the generate_grammar.py script.

Update the generated source code with the ``generate.sh`` script:

.. code::

$ ./generate.sh <version>
$ git commit -a -m "Bump to version <version>"
$ git push origin master

Then for each language, perform a release of the corresponding package.

Java
~~~~

.. code::

$ cd java/
$ mvn clean deploy -P release-sign-artifacts -DperformRelease=true -DrepositoryId=ossrh -Dgpg.useagent=false

Javascript
~~~~~~~~~~

.. code::

$ cd javascript/
$ npm publish
$ aws s3 cp signalflow-grammar-<version>.js s3://public-sites--signalfx-com/cdn/

Python
~~~~~~

.. code::

$ cd python/
$ python setup.py bdist_wheel
$ twine upload dist/signalflow_grammar-<version>-py2-none-any.whl


Metadata

Release files for signalflow-grammar 2.12.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for signalflow-grammar 2.12.0
File Interpreter ABI Platform
signalflow_grammar-2.12.0-py2-none-any.whl Python 2 none any Details

Release files / signalflow_grammar-2.12.0-py2-none-any.whl

Download URL signalflow_grammar-2.12.0-py2-none-any.whl
Size 37.4 kB
Tags Python 2
SHA-256 checksum
How to use checksums
b0c1b52e942ed59d141df0691e55d347bfde615e8f7a913d0c5a67303808d987
BLAKE2b-256 checksum
How to use checksums
e30edda9213a6084bc63eb5e012faefab6ced3e87305eb9e9fc1ea0f396b35c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

2.12.0 This release

1 release file

2.11.1

1 release file

2.11.0

1 release file

2.10.0

1 release file

2.9.0

1 release file

2.8.1

1 release file

2.8.0

1 release file

2.7.0

1 release file

2.6.0

1 release file

2.5.0

1 release file

2.4.0

1 release file

2.3.0

1 release file

2.2.0

1 release file

2.1.0

1 release file

2.0.0

1 release file

1.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page