blob: 6486b21184eb5d01d5c2d961faafd620ce11e115 [file] [log] [blame]
<html><head><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>5.4.6.&nbsp;Integer Constants</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_StringConstant.html" title="5.4.5.&nbsp;String Constant"><link rel="next" href="def_FloatConstant.html" title="5.4.7.&nbsp;Float Constant"></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.6.&nbsp;Integer Constants</th></tr><tr><td align="left" width="20%"><a accesskey="p" href="def_StringConstant.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_FloatConstant.html">Next</a></td></tr></table><hr></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="def_IntConstant"></a>5.4.6.&nbsp;Integer Constants</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_IntConstant_Description"></a>Description</th></tr><tr><td valign="top" align="left"><p>
<span class="strong"><strong>Integer constants</strong></span>
<a name="N12A22" class="indexterm"></a>
<a name="N12A27" class="indexterm"></a>
can be represented as octal, decimal or hexadecimal constants.
</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_IntConstant_Syntax"></a>Syntax</th></tr><tr><td valign="top" align="left"><pre class="programlisting">
IntConstantAST ::= <a href="def_IntegerLiteral.html" title="6.3.1.&nbsp;Integer Literal">DecimalIntegerLiteral</a> | <a href="def_IntegerLiteral.html" title="6.3.1.&nbsp;Integer Literal">IntegerLiteral</a>
</pre><p>
The different representations of integers are differentiated by their first
characters, which is followed by the possible numerical characters:
</p><div class="itemizedlist"><ul type="disc"><li><p>an <span class="emphasis"><em>octal integer</em></span>
<div class="itemizedlist"><ul type="circle"><li><p>starts with a <code class="computeroutput">0</code>character that is followed by an <span class="strong"><strong>octal digit</strong></span><a name="N12A51" class="indexterm"></a>,
</p></li><li><p>can contain the <code class="computeroutput">0</code>.. <code class="computeroutput">7</code>characters;
</p></li></ul></div>
</p></li><li><p>a <span class="emphasis"><em>decimal integer</em></span>
<div class="itemizedlist"><ul type="circle"><li><p>starts with a positive digit (<code class="computeroutput">1..9</code>),
</p></li><li><p>can contain the <code class="computeroutput">0..9</code> characters;
</p></li></ul></div>
</p></li><li><p>a <span class="emphasis"><em>hexadecimal integer</em></span>
<div class="itemizedlist"><ul type="circle"><li><p>starts with a <code class="computeroutput">0</code> character that is followed by a small or large <span class="emphasis"><em>X</em></span>
(<code class="computeroutput">x</code>/ <code class="computeroutput">X</code>),
</p></li><li><p>can contain the <code class="computeroutput">0..9</code>, <code class="computeroutput">a..f</code>,
<code class="computeroutput">A..F</code> characters.
</p></li></ul></div>
</p></li></ul></div><p>
Each representation of an integer can have three different types related to
the internal representation:
<div class="itemizedlist"><ul type="disc"><li><p><span class="emphasis"><em>normal</em></span> (there is no type modifier at the end of the number),
</p></li><li><p><span class="emphasis"><em>unsigned</em></span> (there is a <code class="computeroutput">u</code>or <code class="computeroutput">U</code>character at the end of the number),
</p></li><li><p><span class="emphasis"><em>long</em></span> (there is an <code class="computeroutput">l</code>or <code class="computeroutput">L</code>character at the end of the number).
</p></li></ul></div>
</p></td></tr></table></div><div class="highlights"><a name="def_IntConstant_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_IntConstant_UsedBy"></a><p><b>Used By:&nbsp;</b>
<a href="def_AsmFunctionDef.html" title="5.5.1.&nbsp;ASM Function Definition">arity</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_StringConstant.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_FloatConstant.html">Next</a></td></tr><tr><td valign="top" align="left" width="40%">5.4.5.&nbsp;String 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.7.&nbsp;Float Constant</td></tr></table></div></body></html>