Options
All
  • Public
  • Public/Protected
  • All
Menu

A context free grammer defination.

Example: A CFG G=({S}, {a}, { S -> aS | S }, S) can be represented as:

{
 nonTerminals: ["S"],
 terminals: ["a"],
 startSymbol: ["S"],
 productions: [
   {
     symbol: ["S"],
     produces: ["a", "S"]
   },
   {
     symbol: ["S"],
     produces: ["a"]
   },
   ...
 ]
}
export
interface

CFGDefination

Hierarchy

  • CFGDefination

Index

Properties

nonTerminals

nonTerminals: string[]

Set of non terminals of grammer.

type

{string[]}

memberof

CFGDefination

productions

productions: Production[]

The array of productions of grammer.

type

{Production[]}

memberof

CFGDefination

startSymbol

startSymbol: string

The start symbol of grammer.

type

{string}

memberof

CFGDefination

terminals

terminals: string[]

Set of terminals of grammer.

type

{string[]}

memberof

CFGDefination

Generated using TypeDoc