Show first sets

Top  Previous  Next

User interface > Debugging and executing > Syntax tree > Show first sets

 

By means of the pop up menu, that appears if the right mouse button is pressed for a node in the syntax tree, information about the first set of the node is displayed (if the node is parsed).

 

Example:

 

Show_Token_en

 

Remark:

Beginning with the version 0.9.8.8 in addition a line is displayed with the options valid for the node. E.g.  Options: sep !icase, global ig  lit  (!all) !rgx

The meaning of these abbreviations is explained below.

 

This box belongs to the alternative in the block production of the Guard example:

 

block =

"{" copy_text

(

block

| STRING copy_text

| SKIP copy_text

)*

"}" copy_text

 

In the tree view:

 

Show_Token_Tree

 

 

1. Caption

 

The caption of the dialog displays the name of the node.

 

2. Header

 

In the first line is written, whether the node is nullable or not.

 

 

3. FIRST SET:

 

The lines of the FIRST SET list are consisting of the name, definition and symbol number of the first set of the node.

 

"{": { (12)

STRING: "([^"]|\\")*" (13)

 

All tokens are listed, which are beginning the alternative chains.

 

In the example the node presents the following alternative:

 

block

| STRING copy_text

| SKIP copy_text

 

"{" is the single token, by which the block-production can begin and STRING is an alternative terminal symbol.

 

4. SKIPS:

 

If a SKIP-symbol belongs to the alternatives of the node, or if the node itself represents a SKIP-symbol, the set of token, to which can be skipped, is shown here.

In the example:

 

"{": { (12)

"}": } (15)

STRING: "([^"]|\\")*" (13)

 

The next position, where one of these tokens appear in the input, will be searched, if none of the tokens, which are listed in point 3, are found at the actual text position

 

 

5. SCANNER FOR NEXT TOKEN

 

Only, if the node represents a terminal symbol or the call of a non-terminal, further token lists can follow for the "SCANNER FOR NEXT TOKEN". While in the lists at point 3 and 4 token are listed, which lead to the current node, in the following lists token are listed, which lead to the next node.

In the same block-production of the example above the display for the block node is:

 

Show_Token_NT_en

 

After a recursive call of the block-production inside of itself, the next token must be found. The candidates for this search are listed in the lists following the title "SCANNER FOR NEXT TOKEN". Either with "{" a new block begins immediately or a string follows or the block will be left with "}". If none of these cases applies - because of the SKIP-symbol - the next position in the text will be searched, where one of these cases applies.

 

 

6. FOLLOWERS IN ALL CALLING PRODUCTIONS

 

 

Finally there is a different list of tokens, if the node represents a terminal symbol "at the end" of a production. "At the end" means, that there is an immediately follower of the node, which does not belong to the actual production.

In the block production, this applies to the node of the closing brace "}". The first sets for this node are the following:

 

Show_EndToken_en

 

In the list following the title "FOLLOWERS IN ALL CALLING PRODUCTIONS" all tokens are listed, which can follow the call of a production. Such a call is the call of the block-production inside of itself.  Therefore followers of this call must be includes in the list of the followed of "}". In point 5 the list of the token, which can follow the call - the next token - already were listed.

 

"{": { (12)

"}": } (15)

STRING: "([^"]|\\")*" (13)

 

The other "FOLLOWERS IN ALL CALLING PRODUCTIONS" are following the calls of block in other productions.

 

 

The last list is changed if it is shown while debugging the Guard-project. The list then will be renamed to:

 

 

7. FOLLOWERS IN ACTUAL CALLING PRODUCTION

 

 

Now only the tokens are listed, which at the actual moment really can follow, that means the followers of the actual call of the production. In the example: the followers of the call of block inside of the block production:

 

Show_EndToken_Running_en

 

 

Now only the token discussed in point 5 are shown. Follower tokens of calls of block from other productions actually are irrelevant.

 

 

Options:

 

Beginning with the version 0.9.8.8 in addition a line is displayed with the options valid for the node.

 

 

Symbol

Abbreviation for

Meaning

!

 

not

sep

separated

word boundaries

icase

ignore case

ignore case

global

 

Settings for the global scanners

ig

ignore

ignorable characters

lit

literals

literal tokens

all

 

test all

rgx

regular expressions

not literal tokens

 

 

E.g. 

 

Options: sep !icase, global ig  lit  (!all) !rgx

 

This means, that literal tokens must be separated words, that case is not ignored and that the global scanners for the ignored characters and for the literal tokens are used.

 

 



This page belongs to the TextTransformer Documentation

Home  Content  German