-
Notifications
You must be signed in to change notification settings - Fork 0
Workflow SimpleDemo
Test your Crodox grammar against real code before you use it on your own repositories.
Here's what you'll do:
- Access the Crodox app
- Create a simple grammar template
- Test the grammar on simpleDemo's pseudo-code files
- See what components your grammar extracts
- Refine your grammar if needed
Start here: https://crodox-app.com/home
- Access to Crodox app at https://crodox-app.com/home
- GitHub account (for authentication)
- GitHub access to the simpleDemo repository (automatic if you have GitHub access)
- Open https://crodox-app.com/home in your browser
- Enter your email address and request a verification code
- Check your email and enter the code
- Authorize the Crodox GitHub app when prompted
- Complete your profile setup (username, local settings)
You are now logged into Crodox.
- In the Crodox app, click the Template Editor icon (code brackets
<>) in the left sidebar - Click the Templates tab
- Enter a name for your test template (e.g.,
simpleDemo_Grammar_v1) - Click the + button to create the template
The template editor opens with an empty grammar definition.
In the Grammar Editor (left panel), write a basic grammar to parse pseudo-code:
<~ file.txt ~>
<: define :> <<name>>
<: function :> <<name>> <- variable ->
<: variable :> <<name>>
Explanation:
-
<~ file.txt ~>– Target text files -
<: define :>– Recognize "define" statements as visible objects -
<<name>>– Capture the name of each object -
<- variable ->– Functions can contain variables as children
- Click Save in the template editor (or press
Ctrl+S) - Crodox validates your grammar
- ✅ Valid – Template is saved and ready to test
- ❌ Error – Review the error message and fix your grammar
If valid, proceed to Step 5.
- In the Project Explorer (center-left panel), open the Repository dropdown
- Look for simpleDemo in the list (or search for it)
- Select simpleDemo (github)
The project explorer now shows the file tree from the simpleDemo repository.
- In the project explorer, expand the simpleDemo folder structure
- Click on one of the test files:
-
testFile.txt(recommended for first test) refFile.txtbridgeTest.txt
-
The file loads in the right-hand preview panel, and your grammar runs against it automatically.
In the Trial Extraction Field (center panel), Crodox displays every component your grammar matched:
-
Component ID - Unique identifier (e.g.,
#262) -
Component Type - What your grammar recognized (e.g.,
define,function) -
Name - The extracted name (e.g.,
testFunction) - Source Path - File and line number
Interpretation:
- ✅ Components appear → Your grammar is correctly parsing the file
- ❌ No components → Your grammar did not match the file syntax
- Review your grammar syntax in the Crodox documentation
- Check that
<: define :>,<: function :>match the actual keywords in the test file - Try a different test file
If your grammar didn't extract components:
- Return to the Grammar Editor (left panel)
- Review the test file content in the preview (right panel)
- Adjust your grammar to match the actual keywords and structure
- Click Save again
- The extraction updates automatically
Example: If testFile.txt uses procedure instead of function, change your grammar to:
<~ file.txt ~>
<: define :> <<name>>
<: procedure :> <<name>> <- variable ->
<: variable :> <<name>>
Repeat Step 6 for other files in simpleDemo:
- Click a different test file
- Review extracted components
- Note any differences in extraction results
This helps you understand how your grammar behaves across different code patterns.
Once your grammar successfully extracts components from simpleDemo files:
- Your template is validated and ready for production use
- You can now create a Workbench to analyze your own repositories
- See Workflow-End-to-End for the next steps
| Issue | Solution |
|---|---|
| No components extracted | Review grammar syntax; check that keywords match the test file |
| Unexpected components | Your grammar may be too broad; refine selectors with <: name :> conditions |
| simpleDemo not visible | Ensure GitHub access is authorized in Settings |
| File won't load | Try a different test file (e.g., testFile.txt instead of bridgeTest.txt) |
Once your grammar is working on simpleDemo:
- Workflow-AngularTemplate – Learn how to build a production template
- Workflow-End-to-End – Create a workbench on your own repositories
- Creating-First-Template – Extended guide on template creation
- Template-Editor – Complete template editor documentation
- Test early, iterate often – Use simpleDemo to validate grammar changes before production use
-
Start simple – Begin with basic
<: name :>patterns, then add complexity -
Use descriptive names – Name your template after its purpose (e.g.,
Python_Parser,Vue_Extractor) - Keep a backup – Export your working grammar before major changes
Start testing now: https://crodox-app.com/home
Demo Repository: https://github.com/crodox-app/simpleDemo
- Getting Started
- Sign-Up
- Home Screen
- Creating Your First Template
- Template Editor
- Application Navigation
- Syntax Overview
- Workflow: End-to-End
- Workflow: Test with simpleDemo
- Workflow: Build Template from angularTemp
- Demo Repositories
- Template
- Workbench
- GitHub Integration
- GitHub App Installation
- GitHub Repository Setup
- GitHub Re-linking
- Settings
- Overview
- Declarations
- Types
- Scoping