Castle Game EngineIntroduction Units Class Hierarchy Classes, Interfaces, Objects and Records Types Variables Constants Functions and Procedures Identifiers |
Unit X3DLexer
Description
VRML/X3D classic lexer (TX3DLexer).
Uses
Overview
Classes, Interfaces, Objects and Records
Functions and Procedures
Types
Constants
VRML10Keywords = [vkDEF, vkUSE, vkFALSE, vkTRUE]; |
VRML20Keywords = [vkDEF .. vkIMPORT]; |
X3DKeywords = [Low(TX3DKeyword) .. High(TX3DKeyword)] -
[vkEventIn, vkEventOut, vkExposedField, vkField]; |
TokenNumbers : TX3DTokens = [vtFloat, vtInteger]; |
X3DKeywordsName: array [TX3DKeyword] of string = (
'DEF', 'EXTERNPROTO', 'FALSE', 'IS', 'NULL', 'PROTO', 'ROUTE',
'TO', 'TRUE', 'USE', 'eventIn', 'eventOut', 'exposedField', 'field',
'AS', 'EXPORT', 'IMPORT',
'COMPONENT', 'META', 'PROFILE', 'UNIT',
'inputOnly', 'outputOnly', 'inputOutput', 'initializeOnly'
); |
Description
Functions and Procedures
function StringToX3DClassic(const s: string): string; |
String encoded for VRML/X3D classic, surrounded by double quotes. You can use this when generating VRML/X3D content by hand.
Simply put, this just adds double quotes around and prepends backslash to all " and \ inside. Fortunately, no other characters (including newlines) need to be quoted in any special way for VRML/X3D. For example:
StringToVRMLStringToken('foo') = '"foo"'
StringToVRMLStringToken('say "yes"') = '"say \"yes\""'
|
function StringToX3DXml(const s: string): string; |
String encoded for X3D XML, surrounded by double quotes. You can use this when generating VRML/X3D content by hand.
Simply put, this just adds double quotes around and replaces all special characters (quotes, double quotes and more) with appropriate XML entities &xxx;.
|
function StringToX3DXmlMulti(const s: string): string; |
String encoded for X3D XML, surrounded by double quotes, to be used as part of MFString.
In addition to what StringToX3DXml does, this additionally adds backslash before " (double quotes), and doubles existing backslashes. Otherwise XML reader may not tell the difference between double quotes delimiting single string item and double quotes inside, as it has to (and DOM units do) treat " and " exactly the same. X3D XML encoding spec shows example confirming this is correct, <Text string='"He said, \"Immel did it!\""' /> .
|
Types
TX3DKeyword = (...); |
Valid keywords for all VRML / X3D versions.
Values
-
vkDEF:
-
vkEXTERNPROTO:
-
vkFALSE:
-
vkIS:
-
vkNULL:
-
vkPROTO:
-
vkROUTE:
-
vkTO:
-
vkTRUE:
-
vkUSE:
-
vkEventIn:
-
vkEventOut:
-
vkExposedField:
-
vkField:
-
vkAS:
-
vkEXPORT:
-
vkIMPORT:
-
vkCOMPONENT:
-
vkMETA:
-
vkPROFILE:
-
vkUNIT:
-
vkInputOnly:
-
vkOutputOnly:
-
vkInputOutput:
-
vkInitializeOnly:
|
TX3DToken = (...); |
Lexer token.
Values
-
vtKeyword:
-
vtName:
-
vtOpenCurlyBracket: Symbols for all VRML versions.
-
vtCloseCurlyBracket:
-
vtOpenSqBracket:
-
vtCloseSqBracket:
-
vtOpenBracket: Symbols below are only for VRML <= 1.0. In VRML 2.0, they are no longer valid symbols (comma is even considered a whitespace). They will never be returned by lexer when reading VRML >= 2.0 files.
-
vtCloseBracket:
-
vtBar:
-
vtComma:
-
vtPeriod: Symbols below are only for VRML >= 2.0. They will never be returned by lexer when reading VRML < 2.0 files.
-
vtColon: Symbols below are only for VRML >= 3.0, that is X3D. They will never be returned by lexer when reading VRML < 3.0 files.
-
vtFloat: Back to version-neutral tokens, suitable for all VRML / X3D versions.
-
vtInteger:
-
vtString:
-
vtEnd: vtEnd means that we're standing at the end of stream, no more tokens. From this point, further reads using NextToken from stream will always result in vtEnd (they will not raise an error).
|
TX3DEncoding = (...); |
Values
|
Constants
VRML10Keywords = [vkDEF, vkUSE, vkFALSE, vkTRUE]; |
|
VRML20Keywords = [vkDEF .. vkIMPORT]; |
|
X3DKeywordsName: array [TX3DKeyword] of string = (
'DEF', 'EXTERNPROTO', 'FALSE', 'IS', 'NULL', 'PROTO', 'ROUTE',
'TO', 'TRUE', 'USE', 'eventIn', 'eventOut', 'exposedField', 'field',
'AS', 'EXPORT', 'IMPORT',
'COMPONENT', 'META', 'PROFILE', 'UNIT',
'inputOnly', 'outputOnly', 'inputOutput', 'initializeOnly'
); |
|
Generated by PasDoc 0.13.0 on 2013-08-17 21:27:15
|