meaning of `ASTSQLSchemaStatement(JJTSQLSCHEMASTATEMENT)` and `jjtree.openNodeScope`

StackOverflow https://stackoverflow.com/questions/16937111

  •  31-05-2022
  •  | 
  •  

Pergunta

these lines appears in the generated file of .jj file

ASTSQLSchemaStatement jjtn000 = new ASTSQLSchemaStatement(JJTSQLSCHEMASTATEMENT);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
Foi útil?

Solução

Together they create a new node and open its scope. (And declare a boolean var.) The node's scope will remain open until it is closed or abandoned. While it is open, it may acquire children. When it is closed it will be pushed on a stack and may become the child of some other open node. See https://javacc.java.net/doc/JJTree.html for more details.

Outras dicas

ASTSQLSchemaStatement jjtn000 = new ASTSQLSchemaStatement(JJTSQLSCHEMASTATEMENT);

This will create an instance of an object of type ASTSQLSchemaStatement.

boolean jjtc000 = true;

This will create a primitive boolean with the value true.

jjtree.openNodeScope(jjtn000);

This is a method call on a variable called jjtree (I don't know what type this is), sending the instance of ASTSQLSchemaStatement we created earlier.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top