Skip to content

Commit

Permalink
Adding readme.dox documentation and the WTFPL license.
Browse files Browse the repository at this point in the history
  • Loading branch information
bingmann committed Aug 19, 2007
1 parent 2436e91 commit 1cd2962
Show file tree
Hide file tree
Showing 8 changed files with 215 additions and 56 deletions.
14 changes: 14 additions & 0 deletions COPYING
@@ -0,0 +1,14 @@
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004

Copyright (C) 2004 Sam Hocevar
14 rue de Plaisance, 75014 Paris, France
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.

DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

0. You just DO WHAT THE FUCK YOU WANT TO.

4 changes: 2 additions & 2 deletions Doxyfile
Expand Up @@ -478,7 +478,7 @@ INPUT_ENCODING = UTF-8
# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py

FILE_PATTERNS =
FILE_PATTERNS = *.c *.cc *.h *.hh *.yy *.ll *.dox

# The RECURSIVE tag can be used to turn specify whether or not subdirectories
# should be searched for input files as well. Possible values are YES and NO.
Expand Down Expand Up @@ -1006,7 +1006,7 @@ EXPAND_ONLY_PREDEF = NO
# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
# in the INCLUDE_PATH (see below) will be search if a #include is found.

SEARCH_INCLUDES = YES
SEARCH_INCLUDES = NO

# The INCLUDE_PATH tag can be used to specify one or more directories that
# contain include files that are not input files but should be processed by
Expand Down
74 changes: 37 additions & 37 deletions src/parser.cc
Expand Up @@ -38,7 +38,7 @@
#include "y.tab.h"

/* User implementation prologue. */
#line 76 "parser.yy"
#line 77 "parser.yy"


#include "driver.h"
Expand Down Expand Up @@ -211,47 +211,47 @@ namespace example
switch (yytype)
{
case 5: /* "\"string\"" */
#line 70 "parser.yy"
#line 71 "parser.yy"
{ delete (yyvaluep->stringVal); };
#line 217 "parser.cc"
break;
case 17: /* "constant" */
#line 71 "parser.yy"
#line 72 "parser.yy"
{ delete (yyvaluep->calcnode); };
#line 222 "parser.cc"
break;
case 18: /* "variable" */
#line 71 "parser.yy"
#line 72 "parser.yy"
{ delete (yyvaluep->calcnode); };
#line 227 "parser.cc"
break;
case 19: /* "atomexpr" */
#line 72 "parser.yy"
#line 73 "parser.yy"
{ delete (yyvaluep->calcnode); };
#line 232 "parser.cc"
break;
case 20: /* "powexpr" */
#line 72 "parser.yy"
#line 73 "parser.yy"
{ delete (yyvaluep->calcnode); };
#line 237 "parser.cc"
break;
case 21: /* "unaryexpr" */
#line 72 "parser.yy"
#line 73 "parser.yy"
{ delete (yyvaluep->calcnode); };
#line 242 "parser.cc"
break;
case 22: /* "mulexpr" */
#line 72 "parser.yy"
#line 73 "parser.yy"
{ delete (yyvaluep->calcnode); };
#line 247 "parser.cc"
break;
case 23: /* "addexpr" */
#line 72 "parser.yy"
#line 73 "parser.yy"
{ delete (yyvaluep->calcnode); };
#line 252 "parser.cc"
break;
case 24: /* "expr" */
#line 72 "parser.yy"
#line 73 "parser.yy"
{ delete (yyvaluep->calcnode); };
#line 257 "parser.cc"
break;
Expand Down Expand Up @@ -329,7 +329,7 @@ namespace example


/* User initialization code. */
#line 40 "/tdata/home/Desktop/cpp-flex-bison/trunk/src/parser.yy"
#line 41 "/tdata/home/Desktop/cpp-flex-bison/trunk/src/parser.yy"
{
// initialize the initial location object
yylloc.begin.filename = yylloc.end.filename = &driver.streamname;
Expand Down Expand Up @@ -451,21 +451,21 @@ namespace example
switch (yyn)
{
case 2:
#line 94 "parser.yy"
#line 95 "parser.yy"
{
(yyval.calcnode) = new CNConstant((yysemantic_stack_[(1) - (1)].integerVal));
}
break;

case 3:
#line 98 "parser.yy"
#line 99 "parser.yy"
{
(yyval.calcnode) = new CNConstant((yysemantic_stack_[(1) - (1)].doubleVal));
}
break;

case 4:
#line 103 "parser.yy"
#line 104 "parser.yy"
{
if (!driver.calc.existsVariable(*(yysemantic_stack_[(1) - (1)].stringVal))) {
error(yyloc, std::string("Unknown variable \"") + *(yysemantic_stack_[(1) - (1)].stringVal) + "\"");
Expand All @@ -480,119 +480,119 @@ namespace example
break;

case 5:
#line 116 "parser.yy"
#line 117 "parser.yy"
{
(yyval.calcnode) = (yysemantic_stack_[(1) - (1)].calcnode);
}
break;

case 6:
#line 120 "parser.yy"
#line 121 "parser.yy"
{
(yyval.calcnode) = (yysemantic_stack_[(1) - (1)].calcnode);
}
break;

case 7:
#line 124 "parser.yy"
#line 125 "parser.yy"
{
(yyval.calcnode) = (yysemantic_stack_[(3) - (2)].calcnode);
}
break;

case 8:
#line 129 "parser.yy"
#line 130 "parser.yy"
{
(yyval.calcnode) = (yysemantic_stack_[(1) - (1)].calcnode);
}
break;

case 9:
#line 133 "parser.yy"
#line 134 "parser.yy"
{
(yyval.calcnode) = new CNPower((yysemantic_stack_[(3) - (1)].calcnode), (yysemantic_stack_[(3) - (3)].calcnode));
}
break;

case 10:
#line 138 "parser.yy"
#line 139 "parser.yy"
{
(yyval.calcnode) = (yysemantic_stack_[(1) - (1)].calcnode);
}
break;

case 11:
#line 142 "parser.yy"
#line 143 "parser.yy"
{
(yyval.calcnode) = (yysemantic_stack_[(2) - (2)].calcnode);
}
break;

case 12:
#line 146 "parser.yy"
#line 147 "parser.yy"
{
(yyval.calcnode) = new CNNegate((yysemantic_stack_[(2) - (2)].calcnode));
}
break;

case 13:
#line 151 "parser.yy"
#line 152 "parser.yy"
{
(yyval.calcnode) = (yysemantic_stack_[(1) - (1)].calcnode);
}
break;

case 14:
#line 155 "parser.yy"
#line 156 "parser.yy"
{
(yyval.calcnode) = new CNMultiply((yysemantic_stack_[(3) - (1)].calcnode), (yysemantic_stack_[(3) - (3)].calcnode));
}
break;

case 15:
#line 159 "parser.yy"
#line 160 "parser.yy"
{
(yyval.calcnode) = new CNDivide((yysemantic_stack_[(3) - (1)].calcnode), (yysemantic_stack_[(3) - (3)].calcnode));
}
break;

case 16:
#line 163 "parser.yy"
#line 164 "parser.yy"
{
(yyval.calcnode) = new CNModulo((yysemantic_stack_[(3) - (1)].calcnode), (yysemantic_stack_[(3) - (3)].calcnode));
}
break;

case 17:
#line 168 "parser.yy"
#line 169 "parser.yy"
{
(yyval.calcnode) = (yysemantic_stack_[(1) - (1)].calcnode);
}
break;

case 18:
#line 172 "parser.yy"
#line 173 "parser.yy"
{
(yyval.calcnode) = new CNAdd((yysemantic_stack_[(3) - (1)].calcnode), (yysemantic_stack_[(3) - (3)].calcnode));
}
break;

case 19:
#line 176 "parser.yy"
#line 177 "parser.yy"
{
(yyval.calcnode) = new CNSubtract((yysemantic_stack_[(3) - (1)].calcnode), (yysemantic_stack_[(3) - (3)].calcnode));
}
break;

case 20:
#line 181 "parser.yy"
#line 182 "parser.yy"
{
(yyval.calcnode) = (yysemantic_stack_[(1) - (1)].calcnode);
}
break;

case 21:
#line 186 "parser.yy"
#line 187 "parser.yy"
{
driver.calc.variables[*(yysemantic_stack_[(3) - (1)].stringVal)] = (yysemantic_stack_[(3) - (3)].calcnode)->evaluate();
std::cout << "Setting variable " << *(yysemantic_stack_[(3) - (1)].stringVal)
Expand All @@ -603,14 +603,14 @@ namespace example
break;

case 25:
#line 198 "parser.yy"
#line 199 "parser.yy"
{
driver.calc.expressions.push_back((yysemantic_stack_[(3) - (2)].calcnode));
}
break;

case 26:
#line 202 "parser.yy"
#line 203 "parser.yy"
{
driver.calc.expressions.push_back((yysemantic_stack_[(3) - (2)].calcnode));
}
Expand Down Expand Up @@ -971,9 +971,9 @@ namespace example
const unsigned char
Parser::yyrline_[] =
{
0, 93, 93, 97, 102, 115, 119, 123, 128, 132,
137, 141, 145, 150, 154, 158, 162, 167, 171, 175,
180, 185, 194, 195, 196, 197, 201
0, 94, 94, 98, 103, 116, 120, 124, 129, 133,
138, 142, 146, 151, 155, 159, 163, 168, 172, 176,
181, 186, 195, 196, 197, 198, 202
};

// Print the state stack on the debug stream.
Expand Down Expand Up @@ -1061,7 +1061,7 @@ namespace example

} // namespace example

#line 208 "parser.yy"
#line 209 "parser.yy"
/*** Additional Code ***/

void example::Parser::error(const Parser::location_type& l,
Expand Down
4 changes: 2 additions & 2 deletions src/parser.h
Expand Up @@ -48,7 +48,7 @@ namespace example
}

/* First part of user declarations. */
#line 3 "parser.yy"
#line 4 "parser.yy"
/*** C/C++ Declarations ***/

#include <stdio.h>
Expand Down Expand Up @@ -111,7 +111,7 @@ namespace example
/// Symbol semantic values.
#ifndef YYSTYPE
union semantic_type
#line 55 "parser.yy"
#line 56 "parser.yy"
{
int integerVal;
double doubleVal;
Expand Down
1 change: 1 addition & 0 deletions src/parser.yy
@@ -1,4 +1,5 @@
/* $Id$ -*- mode: c++ -*- */
/** \file parser.yy Contains the example Bison parser source */

%{ /*** C/C++ Declarations ***/

Expand Down

0 comments on commit 1cd2962

Please sign in to comment.