[Libreoffice-commits] help.git: AllLangHelp_sbasic.mk Package_html_media.mk source/auxiliary source/media source/text

Alain Romedenne (via logerrit) logerrit at kemper.freedesktop.org
Thu Jul 9 15:26:27 UTC 2020


 AllLangHelp_sbasic.mk                            |    3 -
 Package_html_media.mk                            |    2 
 source/auxiliary/sbasic.tree                     |    1 
 source/media/helpimg/sbasic/a_statement.svg      |   44 +++++++++++++++
 source/media/helpimg/sbasic/comment_fragment.svg |   35 ++++++++++++
 source/text/sbasic/shared/03010103.xhp           |    2 
 source/text/sbasic/shared/03090406.xhp           |    2 
 source/text/sbasic/shared/03090409.xhp           |    4 -
 source/text/sbasic/shared/conventions.xhp        |   66 +++++++++++++++++++++++
 9 files changed, 154 insertions(+), 5 deletions(-)

New commits:
commit 290bab91dab73ea80e595c3b284926c7e01b35d1
Author:     Alain Romedenne <LibreOfficiant at sfr.fr>
AuthorDate: Thu Jul 9 09:37:11 2020 +0200
Commit:     Olivier Hallot <olivier.hallot at libreoffice.org>
CommitDate: Thu Jul 9 17:26:05 2020 +0200

    tdf#131416 How to read syntax diagrams
    
    
    
    Change-Id: Ic8ec05c75658f600f5ea1509acb482cc3db5d796
    Reviewed-on: https://gerrit.libreoffice.org/c/help/+/98343
    Tested-by: Jenkins
    Reviewed-by: Olivier Hallot <olivier.hallot at libreoffice.org>

diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk
index 9a49cdaab..aa40d7b18 100644
--- a/AllLangHelp_sbasic.mk
+++ b/AllLangHelp_sbasic.mk
@@ -359,12 +359,13 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\
     helpcontent2/source/text/sbasic/shared/03170000 \
     helpcontent2/source/text/sbasic/shared/03170010 \
     helpcontent2/source/text/sbasic/shared/05060700 \
-    helpcontent2/source/text/sbasic/shared/code-stubs \
     helpcontent2/source/text/sbasic/shared/calc_functions \
+    helpcontent2/source/text/sbasic/shared/code-stubs \
     helpcontent2/source/text/sbasic/shared/classmodule \
     helpcontent2/source/text/sbasic/shared/compatible \
     helpcontent2/source/text/sbasic/shared/compatibilitymode \
     helpcontent2/source/text/sbasic/shared/Compiler_options \
+    helpcontent2/source/text/sbasic/shared/conventions \
     helpcontent2/source/text/sbasic/shared/enum \
     helpcontent2/source/text/sbasic/shared/ErrVBA \
     helpcontent2/source/text/sbasic/shared/fragments \
diff --git a/Package_html_media.mk b/Package_html_media.mk
index 2a7a8e767..92d69fb0b 100644
--- a/Package_html_media.mk
+++ b/Package_html_media.mk
@@ -107,9 +107,11 @@ $(eval $(call gb_Package_add_files_with_dir,helpcontent2_html_media,$(LIBO_SHARE
     helpimg/smzb7.png \
     helpimg/smzb8.png \
     helpimg/smzb9.png \
+    helpimg/sbasic/a_statement.svg \
     helpimg/sbasic/argument_fragment.svg \
     helpimg/sbasic/array_fragment.svg \
     helpimg/sbasic/char_fragment.svg \
+    helpimg/sbasic/comment_fragment.svg \
     helpimg/sbasic/typename_fragment.svg \
     helpimg/sbasic/Call_statement.svg \
     helpimg/sbasic/Const_statement.svg \
diff --git a/source/auxiliary/sbasic.tree b/source/auxiliary/sbasic.tree
index b44630a98..62ce8a0d1 100644
--- a/source/auxiliary/sbasic.tree
+++ b/source/auxiliary/sbasic.tree
@@ -37,6 +37,7 @@
                 <topic id="sbasic/text/sbasic/shared/Compiler_options.xhp">Compiler options</topic>
                 <topic id="sbasic/text/sbasic/shared/01020300.xhp">Using Procedures and Functions</topic>
                 <topic id="sbasic/text/sbasic/shared/01020500.xhp">Libraries, Modules and Dialogs</topic>
+                <topic id="sbasic/text/sbasic/shared/conventions.xhp">How to Read Syntax Diagrams</topic>
                 <node id="07010202" title="Functions, Statements, and Operators">
                     <topic id="sbasic/text/sbasic/shared/03010000.xhp">Screen I/O Functions</topic>
                     <topic id="sbasic/text/sbasic/shared/03020000.xhp">File I/O Functions</topic>
diff --git a/source/media/helpimg/sbasic/a_statement.svg b/source/media/helpimg/sbasic/a_statement.svg
new file mode 100644
index 000000000..866ed215c
--- /dev/null
+++ b/source/media/helpimg/sbasic/a_statement.svg
@@ -0,0 +1,44 @@
+<svg class="railroad-diagram" height="155" viewBox="0 0 567.0 155" width="567.0" xmlns="http://www.w3.org/2000/svg">
+<g transform="translate(.5 .5)">
+<style>/* <![CDATA[ */
+    svg.railroad-diagram {
+        background-color:transparent;
+    }
+    svg.railroad-diagram path {
+        stroke-width:1;
+        stroke:black;
+        fill:rgba(0,0,0,0);
+    }
+    svg.railroad-diagram text {
+        font:bold 14px monospace;
+        font-family: Verdana, sans-serif;
+        text-anchor:middle;
+    }
+    svg.railroad-diagram text.label{
+        text-anchor:start;
+    }
+    svg.railroad-diagram text.comment{
+        font:italic 12px monospace;
+    }
+    svg.railroad-diagram rect{
+        stroke-width:1;
+        stroke:black;
+        fill:transparent;
+    }
+
+/* ]]> */
+</style><g>
+<path d="M20 41v20m10 -20v20m-10 -10h20"></path></g><path d="M40 51h10"></path><g>
+<path d="M50 51h0.0"></path><path d="M517.0 51h0.0"></path><g>
+<path d="M50.0 51h0.0"></path><path d="M377.5 51h0.0"></path><path d="M50.0 51a15 15 0 0 0 15 -15v-1a15 15 0 0 1 15 -15"></path><g>
+<path d="M80.0 20h267.5"></path></g><path d="M347.5 20a15 15 0 0 1 15 15v1a15 15 0 0 0 15 15"></path><path d="M50.0 51h30"></path><g>
+<path d="M80.0 51h0.0"></path><path d="M347.5 51h0.0"></path><path d="M80.0 51h15"></path><g>
+<path d="M95.0 51h0.0"></path><path d="M332.5 51h0.0"></path><g>
+<path d="M95.0 51h0.0"></path><path d="M226.0 51h0.0"></path><path d="M95.0 51h30"></path><g>
+<path d="M125.0 51h71.0"></path></g><path d="M196.0 51h30"></path><path d="M95.0 51a15 15 0 0 1 15 15v1a15 15 0 0 0 15 15"></path><g class="terminal">
+<path d="M125.0 82h0.0"></path><path d="M196.0 82h0.0"></path><rect height="22" rx="10" ry="10" width="71.0" x="125.0" y="71"></rect><text x="160.5" y="86">label:</text></g><path d="M196.0 82a15 15 0 0 0 15 -15v-1a15 15 0 0 1 15 -15"></path></g><path d="M226.0 51h10"></path><g class="terminal">
+<path d="M236.0 51h0.0"></path><path d="M332.5 51h0.0"></path><rect height="22" rx="10" ry="10" width="96.5" x="236.0" y="40"></rect><text x="284.25" y="55">statement</text></g></g><path d="M332.5 51h15"></path><path d="M95.0 51a15 15 0 0 0 -15 15v43a15 15 0 0 0 15 15"></path><g class="terminal">
+<path d="M95.0 124h104.5"></path><path d="M228.0 124h104.5"></path><rect height="22" rx="10" ry="10" width="28.5" x="199.5" y="113"></rect><text x="213.75" y="128">:</text></g><path d="M332.5 124a15 15 0 0 0 15 -15v-43a15 15 0 0 0 -15 -15"></path></g><path d="M347.5 51h30"></path></g><g>
+<path d="M377.5 51h0.0"></path><path d="M517.0 51h0.0"></path><path d="M377.5 51a15 15 0 0 0 15 -15v-1a15 15 0 0 1 15 -15"></path><g>
+<path d="M407.5 20h79.5"></path></g><path d="M487.0 20a15 15 0 0 1 15 15v1a15 15 0 0 0 15 15"></path><path d="M377.5 51h30"></path><g class="non-terminal">
+<path d="M407.5 51h0.0"></path><path d="M487.0 51h0.0"></path><rect height="22" width="79.5" x="407.5" y="40"></rect><text x="447.25" y="55">comment</text></g><path d="M487.0 51h30"></path></g></g><path d="M517.0 51h10"></path><path d="M 527.0 51 h 20 m -10 -10 v 20 m 10 -20 v 20"></path></g></svg>
\ No newline at end of file
diff --git a/source/media/helpimg/sbasic/comment_fragment.svg b/source/media/helpimg/sbasic/comment_fragment.svg
new file mode 100644
index 000000000..b3b035cc0
--- /dev/null
+++ b/source/media/helpimg/sbasic/comment_fragment.svg
@@ -0,0 +1,35 @@
+<svg class="railroad-diagram" height="104" viewBox="0 0 302.0 104" width="302.0" xmlns="http://www.w3.org/2000/svg">
+<g transform="translate(.5 .5)">
+<style>/* <![CDATA[ */
+    svg.railroad-diagram {
+        background-color:transparent;
+    }
+    svg.railroad-diagram path {
+        stroke-width:1;
+        stroke:black;
+        fill:rgba(0,0,0,0);
+    }
+    svg.railroad-diagram text {
+        font:bold 14px monospace;
+        font-family: Verdana, sans-serif;
+        text-anchor:middle;
+    }
+    svg.railroad-diagram text.label{
+        text-anchor:start;
+    }
+    svg.railroad-diagram text.comment{
+        font:italic 12px monospace;
+    }
+    svg.railroad-diagram rect{
+        stroke-width:1;
+        stroke:black;
+        fill:transparent;
+    }
+
+/* ]]> */
+</style><g>
+<path d="M20 63v20m0 -10h20"></path></g><g>
+<path d="M40 73h0.0"></path><path d="M145.5 73h0.0"></path><path d="M40.0 73a15 15 0 0 0 15 -15v-12a15 15 0 0 1 15 -15"></path><g class="terminal">
+<path d="M70.0 31h0.0"></path><path d="M115.5 31h0.0"></path><rect height="22" rx="10" ry="10" width="45.5" x="70.0" y="20"></rect><text x="92.75" y="35">REM</text></g><path d="M115.5 31a15 15 0 0 1 15 15v12a15 15 0 0 0 15 15"></path><path d="M40.0 73h30"></path><g class="terminal">
+<path d="M70.0 73h8.5"></path><path d="M107.0 73h8.5"></path><rect height="22" rx="10" ry="10" width="28.5" x="78.5" y="62"></rect><text x="92.75" y="77">'</text></g><path d="M115.5 73h30"></path></g><path d="M145.5 73h10"></path><g class="terminal">
+<path d="M155.5 73h0.0"></path><path d="M252.0 73h0.0"></path><rect height="22" rx="10" ry="10" width="96.5" x="155.5" y="62"></rect><text x="203.75" y="77">some_text</text></g><path d="M252.0 73h10"></path><path d="M 262.0 73 h 20 m 0 -10 v 20"></path></g></svg>
\ No newline at end of file
diff --git a/source/text/sbasic/shared/03010103.xhp b/source/text/sbasic/shared/03010103.xhp
index 52cccd7ec..e49aabc4f 100644
--- a/source/text/sbasic/shared/03010103.xhp
+++ b/source/text/sbasic/shared/03010103.xhp
@@ -38,7 +38,7 @@
 </bookmark>
 
 
-<paragraph id="hd_id3147230" role="heading" level="1" xml-lang="en-US"><link href="text/sbasic/shared/03010103.xhp" name="Print Statement">Print Statement</link></paragraph>
+<h1 id="hd_id3147230" xml-lang="en-US"><variable id="Print_h1"><link href="text/sbasic/shared/03010103.xhp" name="Print Statement">Print Statement</link></variable></h1>
 <paragraph id="par_id3156281" role="paragraph" xml-lang="en-US">Outputs the specified strings or numeric expressions to a dialog or to a file.</paragraph>
 </section>
 
diff --git a/source/text/sbasic/shared/03090406.xhp b/source/text/sbasic/shared/03090406.xhp
index eb10a54c3..859d4e34b 100644
--- a/source/text/sbasic/shared/03090406.xhp
+++ b/source/text/sbasic/shared/03090406.xhp
@@ -37,7 +37,7 @@
 </section>
 
 <section id="TwinMethods">
-<note id="par_id661588586825434"><literal>Sub</literal> or <literal>Function</literal> statements are similar methods, without distinction. They receive parameters by reference allowing them to be modified. %PRODUCTNAME  Basic compiler accepts their respective syntax to be used interchangeably.</note>
+<note id="par_id661588586825434"><literal>Sub</literal>, <literal>Function</literal> or <literal>Property</literal> statements are similar methods, without distinction. They receive parameters by reference allowing them to be modified in return. %PRODUCTNAME  Basic compiler accepts their respective argument syntax to be used interchangeably.</note>
 </section>
 
 <embed href="text/sbasic/shared/00000003.xhp#functsyntax"/>
diff --git a/source/text/sbasic/shared/03090409.xhp b/source/text/sbasic/shared/03090409.xhp
index 9dbe58789..89d4086d3 100644
--- a/source/text/sbasic/shared/03090409.xhp
+++ b/source/text/sbasic/shared/03090409.xhp
@@ -32,10 +32,10 @@
   <bookmark_value>Sub statement</bookmark_value>
 </bookmark>
 
-<paragraph id="hd_id3147226" role="heading" level="1" xml-lang="en-US"><link href="text/sbasic/shared/03090409.xhp" name="Sub Statement">Sub Statement</link></paragraph>
+<h1 id="hd_id3147226"><variable id="Sub_h1"><link href="text/sbasic/shared/03090409.xhp" name="Sub Statement">Sub Statement</link></variable></h1>
 <paragraph id="par_id3153311" role="paragraph" xml-lang="en-US">Defines a subroutine.</paragraph>
 </section>
-<embed href="text/sbasic/shared/03090406.xhp#TwinMethods"/>  
+<embed href="text/sbasic/shared/03090406.xhp#TwinMethods"/>
 
 <embed href="text/sbasic/shared/00000003.xhp#functsyntax"/>
 <paragraph role="paragraph" id="par_id971587473488701">
diff --git a/source/text/sbasic/shared/conventions.xhp b/source/text/sbasic/shared/conventions.xhp
new file mode 100644
index 000000000..e1df81afa
--- /dev/null
+++ b/source/text/sbasic/shared/conventions.xhp
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<helpdocument version="1.0">
+    <!--
+    * This file is part of the LibreOffice project.
+    *
+    * This Source Code Form is subject to the terms of the Mozilla Public
+    * License, v. 2.0. If a copy of the MPL was not distributed with this
+    * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+    *
+     -->
+    <meta>
+        <topic id="org.LibreOffice.Help.conventions">
+            <title id="tit" xml-lang="en-US"></title>
+            <filename>/text/sbasic/shared/conventions.xhp</filename>
+        </topic>
+    </meta>
+    <body>
+    <bookmark xml-lang="en-US" branch="index" id="bm_id861593777289558">
+        <bookmark_value>Syntax diagrams; How to read</bookmark_value>
+        <bookmark_value>Statements syntax;How to read</bookmark_value>
+        <bookmark_value>Typographical conventions</bookmark_value>
+    </bookmark>
+    <h1 id="hd_id221543446540070"><link href="text/sbasic/shared/conventions.xhp" name="conventions">How to Read Syntax Diagrams and Statements</link></h1>
+    <paragraph role="paragraph" id="par_id601593699108443">%PRODUCTNAME Basic statements use syntax diagrams and textual conventions that follow these typographical rules:</paragraph>
+    <list type="unordered">
+        <listitem><paragraph id="par_id158193699546735" role="listitem">LibreOffice Basic keywords or functions use propercasing: Call, DimArray, InputBox, Property.</paragraph></listitem>
+        <listitem><paragraph id="par_id711593699548486" role="listitem">Lowercase characters indicate information to supply: end, expression, start, variable.</paragraph></listitem>
+    </list>
+    <paragraph role="paragraph" id="par_id881593760345504">The syntax of a %PRODUCTNAME Basic one line statement is illustrated herewith:</paragraph>
+
+    <h2 id="hd_id871593700670279">Diagram example</h2>
+    <list type="unordered">
+        <listitem><paragraph id="par_id181593699574635" role="listitem">Basic statement diagrams start and end with double vertical bars,</paragraph></listitem>
+        <listitem><paragraph id="par_id711596399548486" role="listitem">Loops indicate a possible repetition, an optional separator may be present,</paragraph></listitem>
+        <listitem><paragraph id="par_id541593706654897" role="listitem">Rectangles denote subsequent diagram fragments,</paragraph></listitem>
+        <listitem><paragraph id="par_id251593706717957" role="listitem">Diagram fragments extremities exhibit single vertical bars.</paragraph></listitem>
+    </list>
+    <paragraph role="image" id="par_id831588865616326"><image src="media/helpimg/sbasic/a_statement.svg" id="img_id651588865616326"><alt id="alt_id281588865616326">syntax of a statement</alt></image></paragraph>
+    <paragraph role="paragraph" id="par_id411579301639711">A set of %PRODUCTNAME Basic statements - with  optional labels - is using a colon <literal>:</literal> sign to separate them, it can be terminated with an optional comment. <literal>REM</literal> or an apostrophe sign introduce a comment.</paragraph>
+    <paragraph role="image" id="par_id931593707147102"><image src="media/helpimg/sbasic/comment_fragment.svg" id="img_id191593707147102"><alt id="alt_id111593707147102">diagram fragment</alt></image></paragraph>
+
+    <h2 id="hd_id71593700691968">Textual example</h2>
+    <list type="unordered">
+        <listitem><paragraph id="par_id181593700546735" role="listitem"><emph>[opt1|opt2|opt3]</emph> Items inside brackets are optional, alternatives are indicated with a vertical bar,</paragraph></listitem>
+        <listitem><paragraph id="par_id181593699546735" role="listitem"><emph>case[[sep]…]</emph> An ellipsis indicates a possible repetition, an optional separator may be specified,</paragraph></listitem>
+        <listitem><paragraph id="par_id712593699548486" role="listitem"><emph>{choice1|choice2}</emph> Items inside curly braces are compulsory, alternatives are indicated with a vertical bar.</paragraph></listitem>
+    </list>
+    <paragraph role="paragraph" id="par_id881593759547050" localize="false"><literal>[ [[label:] statement] : ] [{REM|'} text]</literal></paragraph>
+    <paragraph role="paragraph" id="par_id411593701639711">A set of %PRODUCTNAME Basic statements - with  optional labels - is using a colon <literal>:</literal> sign to separate them, it can be terminated with an optional comment. <literal>REM</literal> or an apostrophe sign introduce a comment.</paragraph>
+
+    <embed href="text/sbasic/shared/00000003.xhp#functexample"/>
+    <bascode>
+       <paragraph role="bascode" id="N0008" localize="false">Sub Main<br/></paragraph>
+       <paragraph role="bascode" id="N0018" xml-lang="en-US">    GoTo there ' skip first statement</paragraph>
+       <paragraph role="bascode" id="N0019" xml-lang="en-US">    here: Print 1, : there: Print 2 REM explanatory text here</paragraph>
+       <paragraph role="bascode" id="N0021" localize="false">End Sub</paragraph>
+    </bascode>
+
+    <section id="relatedtopics" >
+        <embed href="text/sbasic/shared/03090302.xhp#GoToh1"/>
+        <embed href="text/sbasic/shared/03010103.xhp#Print_h1"/>
+        <embed href="text/sbasic/shared/03090407.xhp#remstatement"/>
+        <embed href="text/sbasic/shared/03090409.xhp#Sub_h1"/>
+    </section>
+</body>
+</helpdocument>
\ No newline at end of file


More information about the Libreoffice-commits mailing list