]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.databoard/cpp/DataBoardTest/libantlr3c-3.2/src/antlr3intstream.c
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.databoard / cpp / DataBoardTest / libantlr3c-3.2 / src / antlr3intstream.c
1 /// \file\r
2 /// Implementation of superclass elements of an ANTLR3 int stream.\r
3 /// The only methods required are an allocator and a destructor.\r
4 /// \addtogroup pANTLR3_INT_STREAM\r
5 /// @{\r
6 \r
7 // [The "BSD licence"]\r
8 // Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC\r
9 // http://www.temporal-wave.com\r
10 // http://www.linkedin.com/in/jimidle\r
11 //\r
12 // All rights reserved.\r
13 //\r
14 // Redistribution and use in source and binary forms, with or without\r
15 // modification, are permitted provided that the following conditions\r
16 // are met:\r
17 // 1. Redistributions of source code must retain the above copyright\r
18 //    notice, this list of conditions and the following disclaimer.\r
19 // 2. Redistributions in binary form must reproduce the above copyright\r
20 //    notice, this list of conditions and the following disclaimer in the\r
21 //    documentation and/or other materials provided with the distribution.\r
22 // 3. The name of the author may not be used to endorse or promote products\r
23 //    derived from this software without specific prior written permission.\r
24 //\r
25 // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\r
26 // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\r
27 // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\r
28 // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\r
29 // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\r
30 // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
31 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
32 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
33 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\r
34 // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
35 \r
36 #include    <antlr3intstream.h>\r
37 \r
38 static  void    freeStream    (pANTLR3_INT_STREAM stream);\r
39 \r
40 ANTLR3_API pANTLR3_INT_STREAM\r
41 antlr3IntStreamNew()\r
42 {\r
43         pANTLR3_INT_STREAM      stream;\r
44 \r
45         // Allocate memory\r
46         //\r
47         stream  = (pANTLR3_INT_STREAM) ANTLR3_CALLOC(1, sizeof(ANTLR3_INT_STREAM));\r
48 \r
49         if      (stream == NULL)\r
50         {\r
51                 return  NULL;\r
52         }\r
53 \r
54         stream->free    =  freeStream;\r
55 \r
56         return stream;\r
57 }\r
58 \r
59 static  void    \r
60 freeStream    (pANTLR3_INT_STREAM stream)\r
61 {\r
62         ANTLR3_FREE(stream);\r
63 }\r
64 \r
65 /// @}\r
66 ///\r