diff --git a/demos/class-antlr-test.html b/demos/class-antlr-test.html new file mode 100644 index 000000000..1681e9c39 --- /dev/null +++ b/demos/class-antlr-test.html @@ -0,0 +1,331 @@ + + + +
+ + +Environment Variable: Loading...
Expected: USE_ANTLR_PARSER=true
Status: Checking...
+Basic class diagram to test ANTLR parser functionality:
++classDiagram + class Animal { + +name: string + +age: int + +makeSound() + } ++
Testing class relationships:
++classDiagram + class Animal { + +name: string + +makeSound() + } + class Dog { + +breed: string + +bark() + } + Animal <|-- Dog ++
This is the problematic diagram that needs debugging:
+Expected Error: Parse error on line 11: Expecting 'STR'
++classDiagram + class Person { + +ID : Guid + +FirstName : string + +LastName : string + -privateProperty : string + #ProtectedProperty : string + ~InternalProperty : string + ~AnotherInternalProperty : List~List~string~~ + } + class People List~List~Person~~ ++
Testing simpler generic type syntax:
++classDiagram + class Person { + +ID : Guid + +FirstName : string + +LastName : string + } + class People { + +items : List~Person~ + } ++
Testing different visibility modifiers:
++classDiagram + class TestClass { + +publicField : string + -privateField : string + #protectedField : string + ~packageField : string + +publicMethod() + -privateMethod() + #protectedMethod() + ~packageMethod() + } ++
+ Testing the new hybrid approach: AST-based editing + TokenStreamRewriter for optimal performance +
+ + ++ Testing the new hybrid AST approach: Order-preserving AST + TokenStreamRewriter for optimal performance +
Environment Variable: Loading...
Expected: USE_ANTLR_PARSER=true
Status: Checking...
+Hybrid Features: AST Building, Order Preservation, Smart Regeneration
Testing participant and actor declarations:
--sequenceDiagram - participant A as Alice - participant B as Bob - actor C as Charlie - - A->>B: Hello Bob - B->>C: Hi Charlie - C-->>A: Hello Alice -+
Test the ability to regenerate sequence diagram code from the parsed AST:
+ +
+ First click "Debug Globals" to check if the parser is available, then select a test case and click "Test AST
+ Regeneration". After that, you can test various modifications:
+
โข ๐ง Test AST Modification - Change message text with surgical editing
+
โข โ Test Add Participant - Add new participant using HybridSequenceEditor
+
โข ๐ท๏ธ Test Update Participant Alias - Add alias to existing participant
+
Check the debug logs below for results.
+
Testing various arrow types and message formats:
--sequenceDiagram - Alice->>Bob: Solid arrow - Bob-->>Alice: Dotted arrow - Alice-xBob: Cross ending - Bob--xAlice: Dotted cross - Alice-)Bob: Open arrow - Bob--)Alice: Dotted open -+
This diagram is rendered using code generated from the AST (not the original input):
+Testing activation boxes and lifelines:
--sequenceDiagram - Alice->>+John: Hello John, how are you? - Alice->>+John: John, can you hear me? - John-->>-Alice: Hi Alice, I can hear you! - John-->>-Alice: I feel great! -+
Test the new hybrid AST features: structured AST building, order preservation, and enhanced debugging:
+ ++ These features demonstrate the enhanced AST capabilities: structured data, validation, and comprehensive + statistics. +
Testing notes over participants:
--sequenceDiagram - participant Alice - participant Bob - - Alice->>Bob: Hello Bob - Note over Alice,Bob: This is a note over both - Note right of Bob: This note is on right of Bob - Note left of Alice: This note is on left of Alice - Bob-->>Alice: Hi Alice --
Testing control flow structures:
--sequenceDiagram - Alice->>Bob: Hello Bob - - loop Every minute - Bob-->>Alice: Great! - end - - alt is sick - Bob->>Alice: Not so good :( - else is well - Bob->>Alice: Feeling fresh like a daisy - end -+
Test results and debug information will appear here...
+