function handleBeginningOfParagraph(bBeginningOfParagraph : node) {
if bBeginningOfParagraph {
@<text:p text:style-name="P1">@
bBeginningOfParagraph = false;
}
}
TrafficLight2OASIS ::=
=> {
@<?xml version="1.0" encoding="UTF-8"?>
<office:document-content xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" office:version="1.0"><office:scripts/><office:font-face-decls><style:font-face style:name="Tahoma1" svg:font-family="Tahoma"/><style:font-face style:name="Courier New" svg:font-family="'Courier New'" style:font-family-generic="modern" style:font-pitch="fixed"/><style:font-face style:name="Lucida Sans Unicode" svg:font-family="'Lucida Sans Unicode'" style:font-pitch="variable"/><style:font-face style:name="Tahoma" svg:font-family="Tahoma" style:font-pitch="variable"/><style:font-face style:name="Times New Roman" svg:font-family="'Times New Roman'" style:font-family-generic="roman" style:font-pitch="variable"/></office:font-face-decls><office:automatic-styles><style:style style:name="P1" style:family="paragraph" style:parent-style-name="Standard"><style:paragraph-properties style:text-autospace="none"/><style:text-properties style:font-name="Courier New" fo:font-size="10pt" style:font-size-asian="10pt" style:font-size-complex="10pt"/></style:style><style:style style:name="P2" style:family="paragraph" style:parent-style-name="Standard"><style:text-properties style:font-name="Courier New" fo:font-size="10pt" style:font-size-asian="10pt" style:font-size-complex="10pt"/></style:style><style:style style:name="T1" style:family="text"><style:text-properties fo:color="#0000ff" fo:font-weight="bold" style:font-weight-asian="bold" style:font-weight-complex="bold"/></style:style><style:style style:name="T2" style:family="text"><style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic"/></style:style><style:style style:name="T3" style:family="text"><style:text-properties fo:color="#0000ff"/></style:style><style:style style:name="T4" style:family="text"><style:text-properties fo:color="#008000"/></style:style><style:style style:name="T5" style:family="text"><style:text-properties fo:color="#0000ff" style:text-position="sub 58%" fo:font-size="12pt" style:font-size-asian="12pt" style:font-size-complex="12pt"/></style:style><style:style style:name="T6" style:family="text"><style:text-properties fo:color="#800000"/></style:style><style:style style:name="T7" style:family="text"><style:text-properties fo:color="#ff0000" fo:font-weight="bold" style:font-weight-asian="bold" style:font-weight-complex="bold"/></style:style><style:style style:name="fr1" style:family="graphic" style:parent-style-name="Graphics"><style:graphic-properties style:mirror="none" fo:clip="rect(0in 0in 0in 0in)" draw:luminance="0%" draw:contrast="0%" draw:red="0%" draw:green="0%" draw:blue="0%" draw:gamma="100%" draw:color-inversion="false" draw:image-opacity="100%" draw:color-mode="standard"/></style:style></office:automatic-styles><office:body><office:text><office:forms form:automatic-focus="false" form:apply-design-mode="false"/><text:sequence-decls><text:sequence-decl text:display-outline-level="0" text:name="Illustration"/><text:sequence-decl text:display-outline-level="0" text:name="Table"/><text:sequence-decl text:display-outline-level="0" text:name="Text"/><text:sequence-decl text:display-outline-level="0" text:name="Drawing"/></text:sequence-decls>@
}
=> local bBeginningOfParagraph = true;
[
#readIdentifier:sWord
=> handleBeginningOfParagraph(bBeginningOfParagraph);
[
#check(sWord in {"activate", "desactivate", "duration", "start", "strategy"})
=> {@<text:span text:style-name="T1">@sWord@</text:span>@}
|
#check(sWord == "vehicles_hour")
=> {@<text:span text:style-name="T3">vehicles</text:span><text:span text:style-name="T5">hour</text:span>@}
|
#check(sWord == "time")
=> {@<text:span text:style-name="T3">@sWord@</text:span>@}
|
=> {@<text:span text:style-name="T2">@sWord@</text:span>@}
]
|
#readCString:sText
=> handleBeginningOfParagraph(bBeginningOfParagraph);
=> {@<text:span text:style-name="T6">"@sText.composeHTMLLikeString()@"</text:span>@}
|
["=>" | "->"]:sSymbol
=> handleBeginningOfParagraph(bBeginningOfParagraph);
=> {@<text:span text:style-name="T7">@sSymbol.composeHTMLLikeString()@</text:span>@}
|
!!"/*"
=> handleBeginningOfParagraph(bBeginningOfParagraph);
[->"*/"]:sComment
=> {@<text:span text:style-name="T4">@sComment.composeHTMLLikeString()@</text:span>@}
|
!!"//"
=> handleBeginningOfParagraph(bBeginningOfParagraph);
[~[['\r']? '\n']]*:sComment
=> {@<text:span text:style-name="T4">@sComment.composeHTMLLikeString()@</text:span>@}
|
'\t'
=> handleBeginningOfParagraph(bBeginningOfParagraph);
=> {@<text:tab />@}
|
['\r']? '\n'
=> {
if bBeginningOfParagraph {
@<text:p text:style-name="P1">@
} else {
bBeginningOfParagraph = true;
}
@</text:p>@
}
|
#readChar:cChar
=> handleBeginningOfParagraph(bBeginningOfParagraph);
=>{@@cChar.composeHTMLLikeString()@@}
]*
=> {
if !bBeginningOfParagraph {
@</text:p>@
}
local sFileName = getShortFilename(getInputFilename());
local sPictureFile = sFileName.rsubString(4) + ".png";
if sFileName.endString(".tlc") && sPictureFile.existFile() {
copyFile(sPictureFile, "OpenOffice2.0/Pictures/" + sPictureFile);
@<text:p text:style-name="P1" /><text:p text:style-name="P1">@
@<draw:frame draw:style-name="fr1" draw:name="graphics1" text:anchor-type="paragraph" @
local sHexaDimensions = rightString(leftString(loadBinaryFile(sPictureFile), 48), 16);
local dheight = $6.9*hexaToDecimal(sHexaDimensions.rightString(8)) / hexaToDecimal(sHexaDimensions.leftString(8))$;
@svg:width="6.9in" @
@svg:height="@$floor($1 + dheight*10$)/10$@in" @
@draw:z-index="0"><draw:image xlink:href="Pictures/@sPictureFile@" xlink:type="simple"@
@ xlink:show="embed" xlink:actuate="onLoad"/></draw:frame></text:p>@
}
@</office:text></office:body></office:document-content>@
}
;
Generated by CodeWorker v3.11.0.1 from CWscript2HTML.cwp.