• No results found

simplebnf — A simple package to format Backus-Naur form∗

N/A
N/A
Protected

Academic year: 2021

Share "simplebnf — A simple package to format Backus-Naur form∗"

Copied!
1
0
0

Bezig met laden.... (Bekijk nu de volledige tekst)

Hele tekst

(1)

simplebnf — A simple package to format

Backus-Naur form

Jay Lee

2020/09/01

This package provides a simple way to typeset grammars written in Backus-Naur form (BNF).

\bnfexpr \bnfannot

These commands are wrappers around \texttt and \textit respectively. \begin{bnfgrammar} text\end{bnfgrammar}

can be used to typeset BNF grammars. The text inside the environment should be formatted as: term1 ::= rhs1 ;; term2 ::= rhs2 ;; ... termk ::= rhsk

where each of the rhs represents alternative syntactic forms of the term. An annotation may accompany each alternative in which case the alternative must be separated from its annotation with a colon (:). If you don’t need annotations, simply omit the colons and annotations altogether. The alternatives themselves are separated using the pipe symbol (|).

A sample code and the result is shown below:

\begin{bnfgrammar} expr ::=

expr + term : sum | term : term ;; term ::= term * a : product | a : variable \end{bnfgrammar}

expr ::= expr + term sum | term term term ::= term * a product

| a variable

This file describes v0.2.0.E-mail: jaeho.lee@snu.ac.kr

Referenties

GERELATEERDE DOCUMENTEN

\author{Author} defines \theauthor \title{Presentation Title} defines \thetitle \date{Date} defines \thedate \institute{Institute} defines \theinstitute \theheadline defined by

This package provides a simple way to typeset Karnaugh maps including automated generation of gray code and op- tions to draw bundles of adjacent cells

Praesent pretium, magna in eleifend egestas, pede pede pretium lorem, quis consectetuer tortor sapien facilisis magna. Mauris quis magna varius nulla

A The area of the needle point, see equation (1), page 1 a The number of angels per unit area, see equation (1), page 1 m The mass of one angel, page 1.. N The number of angels

This work may be distributed and/or modified under the conditions of the L A TEX Project Public License, either version 1.3 of this license or (at your option) any later version..

The \sublabon command is to be given in the first equation to be bracket- ted, before the \label and \\ commands, while the \sublaboff command is given after the \\ of the last

However, remember that texsurgery is a python project whose main focus is on evaluating code inside a jupyter kernel, and this is only achieved by installing the python package

Praesent pretium, magna in eleifend egestas, pede pede pretium lorem, quis consectetuer tortor sapien facilisis magna.. Mauris quis magna varius nulla