# p23r-selection-compiler

> Translating P23R selection expressions to xquery code for a P23R processor or P23R source connector

Latest version **1.0.0** (published 2015-03-25) · BSD-3-Clause license · 0 weekly downloads

## Install

```sh
npm install p23r-selection-compiler
pnpm add p23r-selection-compiler
yarn add p23r-selection-compiler
bun add p23r-selection-compiler
```

Provides the command `dats2xquery`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2015-03-25 |
| First published | 2015-03-25 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10.0 |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Jan Gottschick / Fraunhofer FOKUS |
| Maintainers | jgottschick |
| Keywords | p23r, selection, processor, connector, compiler |

## Links

- npm: https://www.npmjs.com/package/p23r-selection-compiler
- Repository: https://gitlab.com/openp23r/p23r-selection-compiler
- Issues: https://gitlab.com/openp23r/p23r-selection-compiler/issues
- npm.io page: https://npm.io/package/p23r-selection-compiler

## Dependencies (2)

- [cli](https://npm.io/package/cli.md) ~0.6.3
- [underscore](https://npm.io/package/underscore.md) ^1.7.0

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2015-03-25

## README

# README.md

Author: Jan Gottschick<jan.gottschick@fokus.fraunhofer.de>

This is a P23R Selection language to Xquery code compiler. P23R Selection is part
of the P23R project and described in its specifications, which are available at

http://www.p23r.de or
https://entwickler.p23r.de


## Usage as a command

The compiler is implemented in Javascript and requires *node.js*, which is available
at

http://nodejs.org

After installing node.js you can install the p23r selection compiler, globally, by

	npm install p23r-selection-compiler -g

and start the compiler by

	dats2xquery

You can enter the p23r selection source code via stdin and the target code will
appear on stdout, e.g. code for the p23r processor

	echo "I'm a comment" | dats2xquery processor

will output

	(: I'm a comment :)

The following options are available:

	Usage:
	  dats2xquery [OPTIONS] [infile [outfile]]

	Create Xquery code from P23R selection expressions.

	Options:
		-s, --start [STRING]   specify a different start rule (Default is start)
		-k, --no-color         Omit color from output
		--debug                Show debug information
		-v, --version          Display the current version
		-h, --help             Display help and usage details

	Commands:
	connector, processor

You must include a command as part of the options to specify for which
p23r component the code should be generated.

## Usage inside your code

You can include the p23r selection compiler in your project, too. If you
build a server side service using node.js just include `p23r-selection-compiler`
in your `package.json` file. You can call the command using a relative path
to `node_modules/p23r-selection-compiler/dats2xquery`. Or you use the library
the usual way, e.g. in coffeescript

	compiler = require 'p23r-selection-compiler'

	...
	connectorTargetCode = compiler.xqueryForConnector(connectorSourceCode)
	processorTargetCode = compiler.xqueryForProcessor(processorSourceCode)

If you like to use the compiler inside your browser code you can load
the p23r selection compiler by using bower. Just include `p23r-selection-compiler`
in your `bower.json` file. Then load the files

* ../p23r-selection-compiler/dist/lib/js/selectionConnectorLib.js
* ../p23r-selection-compiler/dist/lib/js/selectionProcessorLib.js

with your web page and call the parser

	connectorTargetCode = selectionConnector.parse(connectorSourceCode)
	processorTargetCode = selectionProcessor.parse(processorSourceCode)

Errors can be handled in both cases using try and catch, e.g.

	try
		connectorTargetCode = selectionConnector.parse(connectorSourceCode)
	catch error
		console.log error.name + " in selection at " + error.line + "," + error.column + ": " + error.message

## Legal issues

This project is part of the *openP23R* initiative. All related projects
are listed at https://gitlab.com/openp23r/openp23r .

The legal conditions see *LICENSE* file.

The project is maintained by P23R-Team (a) Fraunhofer FOKUS

---
_Source: https://npm.io/package/p23r-selection-compiler · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
