FAUST compiler  0.9.9.6b8
Functions | Variables
errormsg.cpp File Reference
#include "errormsg.hh"
#include "boxes.hh"
#include "ppbox.hh"
#include <iostream>
Include dependency graph for errormsg.cpp:

Go to the source code of this file.

Functions

void yyerror (const char *msg)
 
void evalerror (const char *filename, int linenum, const char *msg, Tree exp)
 
void evalerrorbox (const char *filename, int linenum, const char *msg, Tree exp)
 
void evalwarning (const char *filename, int linenum, const char *msg, Tree exp)
 
void evalremark (const char *filename, int linenum, const char *msg, Tree exp)
 
void setDefProp (Tree sym, const char *filename, int lineno)
 
const char * getDefFileProp (Tree sym)
 
int getDefLineProp (Tree sym)
 

Variables

const char * yyfilename = "????"
 
int gErrorCount = 0
 
Tree DEFLINEPROP = tree(symbol("DefLineProp"))
 

Function Documentation

void evalerror ( const char *  filename,
int  linenum,
const char *  msg,
Tree  exp 
)

Definition at line 40 of file errormsg.cpp.

References gErrorCount, and print().

Referenced by applyList(), eval2double(), eval2int(), evalIdDef(), larg2par(), real_a2sb(), and realeval().

41 {
42  fprintf(stderr, "%s:%d: ERROR: %s ", filename, linenum, msg);
43  print(exp,stderr); fprintf(stderr, "\n");
44  gErrorCount++;
45 }
int gErrorCount
Definition: errormsg.cpp:31
void print(Tree t, FILE *out)
Definition: list.cpp:154

Here is the call graph for this function:

Here is the caller graph for this function:

void evalerrorbox ( const char *  filename,
int  linenum,
const char *  msg,
Tree  exp 
)

Definition at line 47 of file errormsg.cpp.

References gErrorCount.

Referenced by applyList().

48 {
49  cerr << filename << ':' << linenum << ": ERROR: " << msg << " : " << boxpp(exp) << endl;
50  gErrorCount++;
51 }
int gErrorCount
Definition: errormsg.cpp:31
Definition: ppbox.hh:58

Here is the caller graph for this function:

void evalremark ( const char *  filename,
int  linenum,
const char *  msg,
Tree  exp 
)

Definition at line 59 of file errormsg.cpp.

References print().

60 {
61  fprintf(stderr, "%s:%d: REMARK: %s ", filename, linenum, msg);
62  print(exp,stderr); fprintf(stderr, "\n");
63 }
void print(Tree t, FILE *out)
Definition: list.cpp:154

Here is the call graph for this function:

void evalwarning ( const char *  filename,
int  linenum,
const char *  msg,
Tree  exp 
)

Definition at line 53 of file errormsg.cpp.

References print().

Referenced by addLayerDef().

54 {
55  fprintf(stderr, "%s:%d: WARNING: %s ", filename, linenum, msg);
56  print(exp,stderr); fprintf(stderr, "\n");
57 }
void print(Tree t, FILE *out)
Definition: list.cpp:154

Here is the call graph for this function:

Here is the caller graph for this function:

const char* getDefFileProp ( Tree  sym)

Definition at line 72 of file errormsg.cpp.

References DEFLINEPROP, getProperty(), hd(), and name().

Referenced by addLayerDef(), evalIdDef(), and realeval().

73 {
74  Tree n;
75  if (getProperty(sym, DEFLINEPROP, n)) {
76  return name(hd(n)->node().getSym());
77  } else {
78  return "????";
79  }
80 }
A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches.
Definition: tree.hh:109
Tree hd(Tree l)
Definition: list.hh:133
Tree DEFLINEPROP
Definition: errormsg.cpp:32
const char * name(Symbol *sym)
Returns the name of a symbol.
Definition: symbol.hh:98
bool getProperty(Tree t, Tree key, Tree &val)
Definition: list.cpp:423

Here is the call graph for this function:

Here is the caller graph for this function:

int getDefLineProp ( Tree  sym)

Definition at line 82 of file errormsg.cpp.

References DEFLINEPROP, Node::getInt(), getProperty(), CTree::node(), and tl().

Referenced by addLayerDef(), evalIdDef(), and realeval().

83 {
84  Tree n;
85  if (getProperty(sym, DEFLINEPROP, n)) {
86  return tl(n)->node().getInt();
87  } else {
88  return -1;
89  }
90 }
A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches.
Definition: tree.hh:109
const Node & node() const
return the content of the tree
Definition: tree.hh:143
Tree DEFLINEPROP
Definition: errormsg.cpp:32
int getInt() const
Definition: node.hh:104
Tree tl(Tree l)
Definition: list.hh:134
bool getProperty(Tree t, Tree key, Tree &val)
Definition: list.cpp:423

Here is the call graph for this function:

Here is the caller graph for this function:

void setDefProp ( Tree  sym,
const char *  filename,
int  lineno 
)

Definition at line 66 of file errormsg.cpp.

References cons(), DEFLINEPROP, setProperty(), and tree().

Referenced by yyparse().

67 {
68  setProperty(sym, DEFLINEPROP, cons(tree(filename), tree(lineno)));
69 }
Tree cons(Tree a, Tree b)
Definition: list.hh:124
Tree DEFLINEPROP
Definition: errormsg.cpp:32
Tree tree(const Node &n)
Definition: tree.hh:186
void setProperty(Tree t, Tree key, Tree val)
Definition: list.cpp:418

Here is the call graph for this function:

Here is the caller graph for this function:

void yyerror ( const char *  msg)

Definition at line 34 of file errormsg.cpp.

References gErrorCount, yyfilename, and yylineno.

Referenced by yyparse().

35 {
36  fprintf(stderr, "%s:%d:%s\n", yyfilename, yylineno, msg);
37  gErrorCount++;
38 }
int gErrorCount
Definition: errormsg.cpp:31
const char * yyfilename
Definition: errormsg.cpp:30
int yylineno
Definition: faustlexer.cpp:357

Here is the caller graph for this function:

Variable Documentation

Tree DEFLINEPROP = tree(symbol("DefLineProp"))

Definition at line 32 of file errormsg.cpp.

Referenced by getDefFileProp(), getDefLineProp(), and setDefProp().

int gErrorCount = 0

Definition at line 31 of file errormsg.cpp.

Referenced by addLayerDef(), evalerror(), evalerrorbox(), main(), printDocDgm(), and yyerror().

const char* yyfilename = "????"