blob: b16a9fdff66a8e55810bb5263dde2148d331726a [file] [log] [blame]
<html><head><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>5.4.5.&nbsp;String Constant</title><link href="style.css" rel="stylesheet" type="text/css"><meta content="DocBook XSL Stylesheets V1.72.0" name="generator"><link rel="start" href="index.html" title="The VIATRA2 Model Transformation Framework"><link rel="up" href="sec_ASMConstants.html" title="5.4.&nbsp;Constants"><link rel="prev" href="def_MultiplicityConstant.html" title="5.4.4.&nbsp;Multiplicity Constant"><link rel="next" href="def_IntConstant.html" title="5.4.6.&nbsp;Integer Constants"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table summary="Navigation header" width="100%"><tr><th align="center" colspan="3">5.4.5.&nbsp;String Constant</th></tr><tr><td align="left" width="20%"><a accesskey="p" href="def_MultiplicityConstant.html">Prev</a>&nbsp;</td><th align="center" width="60%">5.4.&nbsp;Constants</th><td align="right" width="20%">&nbsp;<a accesskey="n" href="def_IntConstant.html">Next</a></td></tr></table><hr></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="def_StringConstant"></a>5.4.5.&nbsp;String Constant</h4></div></div></div><div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Tip: Description"><tr><td valign="top" align="center" rowspan="2" width="25"><img alt="[Tip]" src="images/tip.png"></td><th align="left"><a name="def_StringConstant_Description"></a>Description</th></tr><tr><td valign="top" align="left"><p>
A <span class="strong"><strong>string constant</strong></span>
<a name="N1298A" class="indexterm"></a>
<a name="N1298F" class="indexterm"></a>
are ASM constants which represent regular Java-like strings.
</p></td></tr></table></div><div class="important" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Important: Syntax"><tr><td valign="top" align="center" rowspan="2" width="25"><img alt="[Important]" src="images/important.png"></td><th align="left"><a name="def_StringConstant_Syntax"></a>Syntax</th></tr><tr><td valign="top" align="left"><pre class="programlisting">
StringConstantAST ::= <a href="def_StringLiteral.html" title="6.2.4.&nbsp;String Literal">StringLiteral</a>
</pre><p>
A string is a sequence of characters. In the constant representation it is
surrounded with double quotation marks (<code class="computeroutput">"</code>). A string literal character can be any
printable ASCII character other than a double quotation mark (<code class="computeroutput">"</code>).
<span class="strong"><strong>Special escape sequences</strong></span><a name="N129AE" class="indexterm"></a>
are defined in <a href="def_StringConstant.html#tab_EscapeSequences" title="Table&nbsp;2.12.&nbsp;Escape sequences and special characters in string constants">Table&nbsp;2.12, &ldquo;Escape sequences and special characters in string constants&rdquo;</a>
</p><div class="table"><a name="tab_EscapeSequences"></a><p class="title"><b>Table&nbsp;2.12.&nbsp;Escape sequences and special characters in string constants</b></p><div class="table-contents"><table summary="Escape sequences and special characters in string constants" border="1"><colgroup><col><col></colgroup><thead><tr><th align="center">Escape sequence</th><th align="center">Description</th></tr></thead><tbody><tr><td align="center">\"</td><td align="center">A double quote character</td></tr><tr><td align="center">\'</td><td align="center">A single quote character</td></tr><tr><td align="center">\n</td><td align="center">A new line character</td></tr><tr><td align="center">\t</td><td align="center">A tabulator character</td></tr><tr><td align="center">\b</td><td align="center">A backspace character</td></tr><tr><td align="center">\r</td><td align="center">A carriage return character</td></tr><tr><td align="center">\f</td><td align="center">A formfeed character</td></tr><tr><td align="center">\0..\7</td><td align="center">An ASCII character with its code</td></tr><tr><td align="center">\00..\77</td><td align="center">An ASCII character with its code</td></tr><tr><td align="center">\000..\377</td><td align="center">An ASCII character with its code</td></tr></tbody></table></div><p></p></div><br class="table-break"></td></tr></table></div><div class="highlights"><a name="def_StringConstant_DefinedIn"></a><p><b>Defined In:&nbsp;</b>
<a href="def_AsmConstant.html" title="5.4.1.&nbsp;ASM Constant (Value)">ASM constant</a>
</p></div><div class="highlights"><a name="def_StringConstant_SeeAlso"></a><p><b>See Also:&nbsp;</b>
<a href="def_ArithmeticTerm.html" title="5.3.1.&nbsp;Arithmetic Term">arithmetic term</a>, <a href="def_Variable.html" title="5.7.2.&nbsp;Variable">variable</a>,
</p></div></div><div class="navfooter"><hr><table summary="Navigation footer" width="100%"><tr><td align="left" width="40%"><a accesskey="p" href="def_MultiplicityConstant.html">Prev</a>&nbsp;</td><td align="center" width="20%"><a accesskey="u" href="sec_ASMConstants.html">Up</a></td><td align="right" width="40%">&nbsp;<a accesskey="n" href="def_IntConstant.html">Next</a></td></tr><tr><td valign="top" align="left" width="40%">5.4.4.&nbsp;Multiplicity Constant&nbsp;</td><td align="center" width="20%"><a accesskey="h" href="index.html">Home</a></td><td valign="top" align="right" width="40%">&nbsp;5.4.6.&nbsp;Integer Constants</td></tr></table></div></body></html>