<html><head><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>5.4.6. 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. Constants"><link rel="prev" href="def_StringConstant.html" title="5.4.5. String Constant"><link rel="next" href="def_FloatConstant.html" title="5.4.7. 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. Integer Constants</th></tr><tr><td align="left" width="20%"><a accesskey="p" href="def_StringConstant.html">Prev</a> </td><th align="center" width="60%">5.4. Constants</th><td align="right" width="20%"> <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. 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. Integer Literal">DecimalIntegerLiteral</a> | <a href="def_IntegerLiteral.html" title="6.3.1. 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: </b> | |
<a href="def_AsmConstant.html" title="5.4.1. ASM Constant (Value)">ASM constant</a> | |
</p></div><div class="highlights"><a name="def_IntConstant_UsedBy"></a><p><b>Used By: </b> | |
<a href="def_AsmFunctionDef.html" title="5.5.1. 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> </td><td align="center" width="20%"><a accesskey="u" href="sec_ASMConstants.html">Up</a></td><td align="right" width="40%"> <a accesskey="n" href="def_FloatConstant.html">Next</a></td></tr><tr><td valign="top" align="left" width="40%">5.4.5. String Constant </td><td align="center" width="20%"><a accesskey="h" href="index.html">Home</a></td><td valign="top" align="right" width="40%"> 5.4.7. Float Constant</td></tr></table></div></body></html> |