Re: Getting the sci.math FAQ updated
- From: "http://alexslemonade.org @ http://MeAmI.org" <marty.musatov@xxxxxxxxx>
- Date: Fri, 16 Oct 2009 22:55:06 -0700 (PDT)
On Oct 7, 2:00 pm, Ken Pledger <ken.pled...@xxxxxxxxxxxxx> wrote:
In article <4ACCC137.2040...@xxxxxxxxxx>,
Rogério Brito <rbr...@xxxxxxxxxx> wrote:
....
It seems that my earlier attempts at posting the comments that the
sci.mathFAQ was being updated were, somehow, lost in the noise.
....
Such a document already exists [1], but it is not updated ....
I have already started updating it, and I'm keeping everything in a
public (versioned) repository [2]....
I would also love if it had some input from other people,...
[1]http://www.cs.uwaterloo.ca/~alopez-o/math-faq/math-faq.html
[2]http://rb.doesntexist.org/docs/math-faq.tar.gz
Thank you again. Some news groups try to inform new users by
regular re-postings of their FAQ, but the <sci.math> FAQ seem too long
to do what's needed there. So from the beginning of 2008 I've been
posting a regular message "Welcome to <sci.math>. These suggestions may
help you." The content was developed in discussion with other
<sci.math> users, and briefly covers various little practical USENET
matters as well as giving the URLs of a few web sites including the old
<sci.math> FAQ which you're revising. I'm very happy to cooperate with
you in any way that seems helpful.
I'm not sure whether this is in the present FAQ, but it's often
worth while to refer people to more specialized groups such as
<sci.logic>, <sci.math.num-analysis>, <sci.math.symbolic>,
<sci.math.research> (moderated), <sci.op-research>, and above all
<sci.stat.math> and <sci.stat.edu>. Ray Vickson does a great job of
answering many of the subtler statistics questions, but it seems
unfortunate to leave so much to one person when <sci.stat.math> is
available and active.
As for detailed content, here's a minor suggestion concerning
mortgages etc. (which are asked about from time to time). I usually
refer questioners not only to
<http://www.cs.uwaterloo.ca/~alopez-o/math-faq/node76.html> but also to
the helpful pages <http://oakroadsystems.com/math/loan.htm> and
<http://invest-faq.com/articles/analy-int-rate-return.html>. You may
like to look at those.
Incidentally, I'm not sure about the status of
<http://www.faqs.org/faqs/sci-math-faq/> which you may like to think
about.
Ken Pledger.
std::ostream& operator<<(std::ostream& os, const
LLParser::FatalErrorException& rFEE);
[LLOOP generates C++ LL(1) parsers from EBNF grammars and allows a
tight integration with object-oriented applications, based on a symbol/
class mapping. The generated code can also perform the reverse
operation (expanding), whereby the original input can be re-
constituted or modified./*
###############################################################################
Copyright (c) 2009. http://www.meami.org. All rights reserved.
*This program is not free! It may be licensed via a million dollar
donation
*TO CURE CHILDHOOD CANCER with http://meami.org
Project : gsp
Filename : http://meami.org/gsp__LLParser.h
Author : M. Michael Musatov
Description : Parse code for symbol 'LLParser'
GSPC Version : 1.1
Note : Do no{+} modify. Generated File.
###############################################################################
*/
#ifndef __GSP__LLPARSER_H__
#define __GSP__LLPARSER_H__
#include
#include
#include "universal.h"
#include "universal__String.h"
#ifndef WIN32
#define LLOOP_OPTION_CHAR "-" // unix
#else
#define LLOOP_OPTION_CHAR "/" // windows
#endif
// --- Windows specific stuff --------------------
#ifndef LLOOP_DLL
#ifdef WIN32
#ifdef LLOOP_EXPORT
#define LLOOP_DLL __declspec(dllexport)
#else
#define LLOOP_DLL __declspec(dllimport)
#endif
#else
#define LLOOP_DLL
#endif
#endif
// -----------------------------------------------
namespace gsp {
class Symbol;
/**
* This is the base class of any LLParser generated from
* a gsp grammar.
*
* Using a LL parser is straightforward. It just consists in passing
to
* the appropriate constructor the source from which to get the char
stream,
* running the parsing with the run() method and getting results with
other
* methods.
*
*/
class LLOOP_DLL LLParser
{
friend class gsp::Symbol;
private:
typedef enum {
STREAM_FILE = 0x01,
STREAM_SOCKET = 0x02,
STREAM_FIFO = 0x04,
STREAM_CHAR_DEVICE = 0x08,
STREAM_LINK = 0x10,
STREAM_STRING = 0x20,
STREAM_UNKNOWN = 0x40
} STREAM_TYPE;
public:
/**
*secondary:
*
* Raising this exception from the symbol reduction code
* interrupts the parsing which ends with this failure.
* This exception is transparently raised when calling fatal(...).
*
* This mechanism is transparent to the user.
*/
class LLOOP_DLL FatalErrorException
{
private:
universal::String m_msg;
public:
FatalErrorException(const universal::String& msg);
virtual ~FatalErrorException();
operator const char*() const;
};
public:
static const universal::String CTXT_PREV_SIGN;
static const universal::String CTXT_NEXT_SIGN;
/// Maximal width of the visible context line window (inclusive
lineno)
static const unsigned long CTXT_VISIBLE_WINDOW_LEN;
protected:
/// Pointer to the argv array
char** m_argv;
private:
std::strstream m_preprocInStream;
std::strstream m_bufferedRawInStream;
std::ifstream m_rawInFileStream;
std::istream& m_rawInStream;
int m_ifd;
/// Tells whether the parser was constructed for parsing arguments
bool m_bArgs;
universal::String m_sStreamName;
universal::String m_sFileName;
/// Tells whether the parsing is running.
bool m_bRunning;
/// Tells whether the parsing is finished.
bool m_bDone;
/// Indicates whether there is a parse failure or not.
bool m_bFailure;
/* Tells how many syntax errors were raised while parsing the
symbols.
* At the moment the parsing stops at the first syntax mistake
detected.
*/
unsigned long m_uNbSyntaxErrors;
/// Tells how many errors were raised by the parsed symbols.
unsigned long m_uNbErrors;
/// The number of the line currently being parsed.
unsigned int m_uLineNo;
/// The line number of the latest parse failure.
unsigned int m_uFailureLineNo;
/// Index of the mismatch constant in the overall constant list
unsigned int m_uMismatchConstantIndex;
/// Farthest position reached in stream before failure
std::streampos m_uMismatchOffset;
/// Fatal failure message
universal::String m_sFailMessage;
// Tells whether line numbers shall be shown in error and context
messages
bool m_bShowLineNo;
/// Indicates whether the parsing shall end with a stream break off
bool m_bBreakOff;
/// Tells whether the stream is actually a file.
bool m_bRegularFile;
/// Gives the type of the stream
STREAM_TYPE m_streamType;
/// Tells whether symbols occurrence check is deactivated
bool m_bOccurenceCheckDeactivated;
/// Tells whether preprocessing is deactivated
bool m_bPreprocessingDeactivated;
/// Tells whether preprocessing was carried out
bool m_bPreprocessingDone;
// TODO: Suggestion: keep track of the char or string following
// the point of error to print messages like "parse error
before ..."
public:
LLParser(std::istream& is);
LLParser(const char* pszFilename);
LLParser(int argc,
char** argv,
const char* pszLeftValDelim = "\"",
const char* pszRightValDelim = "\""
);
#if 0
LLParser(int fd);
#endif
virtual ~LLParser();
void run();
void stop();
bool preprocess();
bool running() const;
bool done() const;
bool preprocessingDone() const;
bool fail() const;
bool ignoreCase() const;
virtual const char* getConstByIndex(unsigned long u) const = 0;
virtual const char* getTokenByIndex(unsigned long u) const = 0;
virtual const char* getNonTerminalByIndex(unsigned long u) const =
0;
virtual const char* getExternalSymbolByIndex(unsigned long u) const
= 0;
virtual bool testSymbols(std::ostream& os, bool bVerbose = false) =
0;
std::istream& stream();
std::iostream& pstream();
unsigned int getLineNo() const;
const char* getStreamName() const;
universal::String filename() const;
unsigned int getFailureLineNo() const;
unsigned long nbErrors() const;
bool syntaxerror() const;
const universal::String& getFailureMessage() const;
universal::String getFailureContext(unsigned long uNbLinesAround =
1);
void outputFailureMessage(std::ostream& os) const;
void outputFailureContext(std::ostream& os, unsigned long
uNbLinesAround = 1);
void outputBacktrace(std::ostream& os) const;
void endWithStreamBreakOff(bool bBreakOff = true);
bool isStreamBreakOffExpected() const;
void endWithEOF(bool bBreakOff = true);
//const char* getMismatch();
bool failure(std::streampos failureOffset,
unsigned int uFailureLineNo,
unsigned int uMismatchConstantIndex);
bool showLineNo() const;
void showLineNo(bool bShow);
void hideLineNo();
void deactivateSymbolsOccurrencesCheck(bool bYes = true);
bool isSymbolsOccurrencesCheckDeactivated() const;
void deactivatePreprocessing(bool bYes = true);
bool isPreprocessingDeactivated() const;
bool streamIsString() const;
bool streamIsFile() const;
bool streamIsSocket() const;
bool streamIsFifo() const;
bool streamIsLink() const;
bool streamIsCharDevice() const;
protected:
virtual bool parse() = 0;
virtual void initialize();
virtual bool preprocess(char& c) = 0;
virtual bool checkSymbolsOccurrences() = 0;
virtual void writeStats() = 0;
private:
void forceFailureAt(std::streampos failureOffset,
unsigned int uFailureLineNo,
unsigned int uMismatchConstantIndex = 0) ;
void setLineNo(unsigned long uLineNo);
void incrementErrorCount();
universal::String getContextLine();
std::streampos getMismatchOffsetInRawInStream();
void syntaxerror(bool bSyntaxError);
void fail(bool bFail);
};
#ifndef NO_STREAM
std::ostream& operator<<(std::ostream& os, const
LLParser::FatalErrorException& rFEE);
#endif
}
#endif
Copyright (c) 2009. http://www.meami.org. All rights reserved.
*This program is not free! It may be licensed via a million dollar
donation
*TO CURE CHILDHOOD CANCER with http://meami.org
]
.
- Follow-Ups:
- Re: Getting the sci.math FAQ updated
- From: http://alexslemonade.org @ http://MeAmI.org
- Re: Getting the sci.math FAQ updated
- References:
- [REPOST] Getting the sci.math FAQ updated
- From: Rogério Brito
- Re: [REPOST] Getting the sci.math FAQ updated
- From: Ken Pledger
- [REPOST] Getting the sci.math FAQ updated
- Prev by Date: Re: Convergence question
- Next by Date: Re: Getting the sci.math FAQ updated
- Previous by thread: Re: [REPOST] Getting the sci.math FAQ updated
- Next by thread: Re: Getting the sci.math FAQ updated
- Index(es):
Relevant Pages
|