How does DataTables get created in the parser

27 views
Skip to first unread message

Anders

unread,
May 4, 2017, 3:20:47 AM5/4/17
to Cukes
Hello,

Trying to write a custom engine/reporter I have found how to pars out the GherkinDocument but, if there exist, I need to pars out the corresponding DataTable in order to get this information. I have searched the code but cant find where the DataTable are parsed. 

Are there any examples/test that parses a feature/Scenario with a Datatable where I can see how this is done and how it can be accessed.

Anders

Eric Kessler

unread,
May 4, 2017, 12:18:08 PM5/4/17
to Cukes
Here is a feature file that uses data tables


and the corresponding AST for the GherkinDocument that the parser will generate

 
Anders


Eric K 

Anders

unread,
May 10, 2017, 4:10:21 AM5/10/17
to Cukes
Hi,

Thanks for the example ast a bit more clear.

Follow up question, from the GherkinDocument, is there a way that I can get an instance of the DataTable class from a given step instance?

Quick look at the code I see that the constructor takes  a List<DataTableRow> and a TableConverter, is there a way from the GherkinDocument to asses the DataTableRows of the table? 

Anders

Aslak Hellesøy

unread,
May 10, 2017, 6:24:01 AM5/10/17
to Cukes


On Wednesday, May 10, 2017 at 9:10:21 AM UTC+1, Anders wrote:
Hi,

Thanks for the example ast a bit more clear.

Follow up question, from the GherkinDocument, is there a way that I can get an instance of the DataTable class from a given step instance?

Quick look at the code I see that the constructor takes  a List<DataTableRow> and a TableConverter, is there a way from the GherkinDocument to asses the DataTableRows of the table? 


What Cucumber/Gherkin build is this for? Java? JavaScript? Ruby?
And what release?

Aslak

Anders

unread,
May 10, 2017, 7:33:50 AM5/10/17
to Cukes
Hi,

Sorry, this is for Java, latest build

Anders
Reply all
Reply to author
Forward
0 new messages