add document of rollback, commot, execute

This commit is contained in:
XudongXie 2024-09-17 14:38:43 +08:00
parent 9a54d05f12
commit 1b04f51349
4 changed files with 28 additions and 21 deletions

View File

@ -4,18 +4,11 @@
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="d8d12963-4777-48e3-9669-309cf5e41d60" name="更改" comment="add ast classes of procedure">
<list default="true" id="d8d12963-4777-48e3-9669-309cf5e41d60" name="更改" comment="add procedure">
<change afterPath="$PROJECT_DIR$/src/main/java/Document/Commit,rollback,execute in Oracle" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/Document/Procedure in Oracle" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/Document/Procedure in Oracle" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/Document/Todolist" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/Document/Todolist" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/Generator/OpenGaussGenerator.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/Generator/OpenGaussGenerator.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/Lexer/OracleLexer.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/Lexer/OracleLexer.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/Main.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/Main.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/Parser/AST/Exception/ExceptionEndNode.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/Parser/AST/Exception/ExceptionEndNode.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/Parser/AST/Procedure/ProcedureColumnNode.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/Parser/AST/Procedure/ProcedureColumnNode.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/Parser/AST/Procedure/ProcedurePLStatementNode.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/Parser/AST/Procedure/ProcedurePLStatementNode.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/Parser/AST/Procedure/ProcedureRetDefNode.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/Parser/AST/Procedure/ProcedureRetDefNode.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/Parser/OracleParser.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/Parser/OracleParser.java" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -113,13 +106,6 @@
<option name="presentableId" value="Default" />
<updated>1723106789329</updated>
</task>
<task id="LOCAL-00032" summary="add parseSelect">
<created>1725981975960</created>
<option name="number" value="00032" />
<option name="presentableId" value="LOCAL-00032" />
<option name="project" value="LOCAL" />
<updated>1725981975960</updated>
</task>
<task id="LOCAL-00033" summary="add parseSelect">
<created>1726041355829</created>
<option name="number" value="00033" />
@ -456,7 +442,14 @@
<option name="project" value="LOCAL" />
<updated>1726496640760</updated>
</task>
<option name="localTasksCounter" value="81" />
<task id="LOCAL-00081" summary="add procedure">
<created>1726554513045</created>
<option name="number" value="00081" />
<option name="presentableId" value="LOCAL-00081" />
<option name="project" value="LOCAL" />
<updated>1726554513046</updated>
</task>
<option name="localTasksCounter" value="82" />
<servers />
</component>
<component name="Vcs.Log.Tabs.Properties">
@ -471,7 +464,6 @@
</option>
</component>
<component name="VcsManagerConfiguration">
<MESSAGE value="add Delete" />
<MESSAGE value="add alter table grammar document" />
<MESSAGE value="add alter table ast class" />
<MESSAGE value="add alter table keywords" />
@ -496,7 +488,8 @@
<MESSAGE value="add exception" />
<MESSAGE value="add document of Procedure" />
<MESSAGE value="add ast classes of procedure" />
<option name="LAST_COMMIT_MESSAGE" value="add ast classes of procedure" />
<MESSAGE value="add procedure" />
<option name="LAST_COMMIT_MESSAGE" value="add procedure" />
</component>
<component name="XDebuggerManager">
<watches-manager>

View File

@ -0,0 +1,14 @@
BEGIN
-- some ddl sql
INSERT INTO my_table (id, value) VALUES (1, 'test');
-- Commit
COMMIT;
-- Failed
ROLLBACK;
END;
/
EXECUTE: EXEC my_procedure('some value');
| EXECUTE IMMEDIATE 'INSERT INTO my_table (id, name) VALUES (1, ''John'')';

View File

@ -23,5 +23,5 @@ Object
 table 1
 view 1
 function ***
 procedure ***
 procedure 1
 trigger ****

View File

@ -36,7 +36,7 @@ public class OracleLexer {
// Exception
, "EXCEPTION", "SQLERRM", "ZERO_DIVIDE", "INVALID_NUMBER", "OTHERS"
// Procedure
, "PROCEDURE", "IS", "IN", "OUT", "$$"
, "PROCEDURE", "IS", "IN", "OUT", "$$", "COMMIT", "ROLLBACK", "EXEC", "EXECUTE"
};
private static final Pattern TOKEN_PATTERN = Pattern.compile(
"(NUMBER\\(.*?\\))|" + // NUMBER() function