@@ -6,7 +6,7 @@ standard C pre-processors with some features added and some missing.
66
77### Distribution
88
9- This repository is the core processor and contain no application . You might use the
9+ This repository is the core processor. You might use the
1010[ Jamplate Gradle Plugin] ( https://github.com/jamplate/gradle ) instead. If you want to use
1111the processor directly or just extend it, you might download the repository or
1212use ` jitpack.io ` . For more info, please visit [ jamplate.org] ( https://jamplate.org )
@@ -22,6 +22,56 @@ dependencies {
2222}
2323```
2424
25+ ### Usage
26+
27+ An example of using the Glucose Implementation:
28+
29+ ``` groovy
30+ Document document = new PseudoDocument(
31+ //name
32+ "main.jamplate",
33+ //content
34+ "#message Hello ' ' World"
35+ )
36+
37+ Unit unit = new UnitImpl(new GlucoseSpec())
38+
39+ if (
40+ !unit.initialize(document) ||
41+ !unit.parse(document) ||
42+ !unit.analyze(document) ||
43+ !unit.compile(document) ||
44+ !unit.execute(document)
45+ ) {
46+ unit.diagnostic()
47+ }
48+ ```
49+
50+ An example of using the Glucose Implementation with the DebugSpec:
51+
52+ ``` groovy
53+ Document document = new PseudoDocument(
54+ //name
55+ "main.jamplate",
56+ //content
57+ "#{ Hello ' ' World }#"
58+ )
59+
60+ Unit unit = new UnitImpl(new GlucoseSpec(
61+ DebugSpec.INSTANCE
62+ ))
63+
64+ if (
65+ !unit.initialize(document) ||
66+ !unit.parse(document) ||
67+ !unit.analyze(document) ||
68+ !unit.compile(document) ||
69+ !unit.execute(document)
70+ ) {
71+ unit.diagnostic()
72+ }
73+ ```
74+
2575### Project Info
2676
2777- GitHub Repository:
0 commit comments