Show / Hide Table of Contents

Class GrammarFileReader

This class generates list of Context Free or Context Sensitive Rules from a text file. see CFGExample.txt and LIGExample.txt for example grammars.

Inheritance
object
GrammarFileReader
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: EarleyParser
Assembly: EarleyParser.dll
Syntax
public class GrammarFileReader

Methods

| Edit this page View Source

CreateRule(string)

Creates a grammar rule from a string representation.

Declaration
public static Rule CreateRule(string s)
Parameters
Type Name Description
string s

The string representation of the rule.

Returns
Type Description
Rule

A new Rule object.

| Edit this page View Source

ReadRules(string[])

Reads grammar rules from an array of strings.

Declaration
public static List<Rule> ReadRules(string[] input)
Parameters
Type Name Description
string[] input

Array of strings containing grammar rules.

Returns
Type Description
List<Rule>

A list of parsed grammar rules.

| Edit this page View Source

ReadRulesFromFile(string, bool)

Reads grammar rules from a file.

Declaration
public static List<Rule> ReadRulesFromFile(string filename, bool isTest = false)
Parameters
Type Name Description
string filename

The path to the grammar file.

bool isTest

If true, treats the file as a test grammar file.

Returns
Type Description
List<Rule>

A list of parsed grammar rules.

  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX