Sha256: 13af0eea847ec54ac3c51e88c8889d93afd12aba923a876a6496a4d1e3087aa6

Contents?: true

Size: 1.63 KB

Versions: 4

Compression:

Stored size: 1.63 KB

Contents

package gherkin.parser;

import gherkin.FixJava;
import gherkin.Lexer;
import gherkin.Listener;
import gherkin.lexer.En;

import java.io.IOException;
import java.util.List;
import java.util.ArrayList;

public class StateMachineReader implements Listener {
    private final String machinePath;
    private List<List<String>> transitionTable;

    public StateMachineReader(String name) {
        machinePath = "/gherkin/parser/" + name + ".txt";
    }

    public List<List<String>> transitionTable() {
		transitionTable = new ArrayList<List<String>>();
        Lexer lexer = new En(this);
        try {
            lexer.scan(FixJava.readResource(machinePath));
        } catch (IOException e) {
            throw new RuntimeException("Fatal error. Couldn't read " + machinePath);
        }
        return transitionTable;
    }

    public void tag(String name, int line) {
    }

    public void comment(String content, int line) {
    }

    public void feature(String keyword, String name, int line) {
    }

    public void background(String keyword, String name, int line) {
    }

    public void scenario(String keyword, String name, int line) {
    }

    public void scenario_outline(String keyword, String name, int line) {
    }

    public void examples(String keyword, String name, int line) {
    }

    public void step(String keyword, String name, int line) {
    }

    public void py_string(String string, int line) {
    }

    public void eof() {
    }

    public void syntax_error(String name, String event, List<String> strings, int line) {
    }

    public void row(List<String> row, int line) {
        transitionTable.add(row);
    }
}

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
gherkin-1.0.3-i386-mswin32 java/src/gherkin/parser/StateMachineReader.java
gherkin-1.0.3-i386-mingw32 java/src/gherkin/parser/StateMachineReader.java
gherkin-1.0.3-java java/src/gherkin/parser/StateMachineReader.java
gherkin-1.0.3 java/src/gherkin/parser/StateMachineReader.java