3 * Description: Virtual Reality Modeling Language (VRML97)
5 * Typesets UTF-8 encoded VRML files including inline scripts
6 * (JavaScript or VrmlScript) using Encript's JavaScript mode.
8 * Note: Some VRML browsers allow use of double quotes in
9 * defining string literals inside inlined scripts. Doing so
10 * breaks the logic programmed here. Using single quotes
11 * (i.e. ECMAScript spec-compliant string literals) works fine.
13 * Author: James Sørlie <sorliej@imm.dtu.dk>
16 state vrml extends HighlightEntry
19 require_state (javascript);
30 /* Inline Script Protocols. */
31 /\"javascript:|\"vrmlscript:/ {
32 reference_face (true);
34 reference_face (false);
36 call (javascript_internal);
39 /* String constants. */
47 /* UTF-8 header text. */
49 reference_face (true);
52 reference_face (false);
56 http://www.vrml.org/Specifications/VRML97/part1/nodesRef.html
58 (build-re '(Introduction Anchor Appearance AudioClip Background
59 Billboard Box Collision Color ColorInterpolator Cone Coordinate
60 CoordinateInterpolator Cylinder CylinderSensor DirectionalLight
61 ElevationGrid Extrusion Fog FontStyle Group ImageTexture
62 IndexedFaceSet IndexedLineSet Inline LOD Material MovieTexture
63 NavigationInfo Normal NormalInterpolator OrientationInterpolator
64 PixelTexture PlaneSensor PointLight PointSet PositionInterpolator
65 ProximitySensor ScalarInterpolator Script Shape Sound Sphere
66 SphereSensor SpotLight Switch Text TextureCoordinate TextureTransform
67 TimeSensor TouchSensor Transform Viewpoint VisibilitySensor
70 /\b(A(nchor|ppearance|udioClip)|B(ackground|illboard|ox)\
71 |C(o(l(lision|or(|Interpolator))|ne|ordinate(|Interpolator))\
73 |DirectionalLight|E(levationGrid|xtrusion)|Fo(g|ntStyle)|Group\
74 |I(mageTexture|n(dexed(FaceSet|LineSet)|line|troduction))|LOD\
75 |M(aterial|ovieTexture)|N(avigationInfo|ormal(|Interpolator))\
76 |OrientationInterpolator\
77 |P(ixelTexture|laneSensor|o(int(Light|Set)|sitionInterpolator)\
79 |S(c(alarInterpolator|ript)|hape|ound|p(here(|Sensor)|otLight)|witch)\
80 |T(ext(|ure(Coordinate|Transform))|imeSensor|ouchSensor|ransform)\
81 |Vi(ewpoint|sibilitySensor)|WorldInfo)\b/ {
88 http://www.vrml.org/Specifications/VRML97/part1/grammar.html#TableA.1 */
89 /\b(DEF|EXTERNPROTO|FALSE|IS|NULL|PROTO|ROUTE|T(O|RUE)|USE|\
90 e(vent(In|Out)|xposedField)|field)\b/ {
97 http://www.vrml.org/Specifications/VRML97/part1/grammar.html#Fields */
98 /\b(MF(Color|Float|Int32|Node|Rotation|String|Time|Vec(2f|3f))|\
99 SF(Bool|Color|Float|Image|Int32|Node|Rotation|String|Time|Vec(2f|3f)))\b/ {