~ubuntu-branches/ubuntu/precise/lilypond/precise

« back to all changes in this revision

Viewing changes to lily/include/lily-parser.hh

  • Committer: Bazaar Package Importer
  • Author(s): Thomas Bushnell, BSG
  • Date: 2006-12-19 10:18:12 UTC
  • mfrom: (3.1.4 feisty)
  • Revision ID: james.westby@ubuntu.com-20061219101812-7awtjkp0i393wxty
Tags: 2.8.7-3
scripts/midi2ly.py: When setting DATADIR, find Lilypond python files
in the @TOPLEVEL_VERSION@ directory, not 'current'.  Patch thanks to
Chris Lamb (chris@chris-lamb.co.uk).  (Closes: #400550)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
  lily-parser.hh -- declare Lily_parser
 
3
 
 
4
  source file of the GNU LilyPond music typesetter
 
5
 
 
6
  (c) 1997--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
 
7
*/
 
8
 
 
9
#ifndef LILY_PARSER_HH
 
10
#define LILY_PARSER_HH
 
11
 
 
12
#include "duration.hh"
 
13
#include "input.hh"
 
14
#include "std-vector.hh"
 
15
#include "pitch.hh"
 
16
 
 
17
/**
 
18
   State for the parser.  Do not ever add any variables to parse
 
19
   musical content here.  We still have to remove default_duration_.
 
20
 
 
21
   TODO: interface is too complicated
 
22
*/
 
23
class Lily_parser
 
24
{
 
25
  DECLARE_SMOBS (Lily_parser,);
 
26
  friend int yyparse (void *);
 
27
 
 
28
  vector<Input> define_spots_;
 
29
 
 
30
  char const *here_str0 () const;
 
31
  Simultaneous_music *get_chord (Pitch tonic,
 
32
                                 vector<Pitch> *adds, vector<Pitch> *subs,
 
33
                                 Pitch *inversion, Pitch *bass, Duration d);
 
34
  void set_chord_tremolo (int type_i);
 
35
  void set_last_duration (Duration const *);
 
36
  void set_last_pitch (Pitch const *);
 
37
 
 
38
public:
 
39
  Lily_lexer *lexer_;
 
40
  Sources *sources_;
 
41
  Duration default_duration_;
 
42
  string output_basename_;
 
43
 
 
44
  int fatal_error_;
 
45
  int error_level_;
 
46
  bool ignore_version_b_;
 
47
 
 
48
  Lily_parser (Sources *sources);
 
49
  Lily_parser (Lily_parser const &);
 
50
 
 
51
  DECLARE_SCHEME_CALLBACK (layout_description, ());
 
52
 
 
53
  void do_init_file ();
 
54
  void do_yyparse ();
 
55
  void parse_file (string init, string name, string out_name);
 
56
  void parse_string (string ly_code);
 
57
  void parser_error (string);
 
58
  void parser_error (Input const &, string);
 
59
  void set_yydebug (bool);
 
60
};
 
61
 
 
62
DECLARE_UNSMOB (Lily_parser, lily_parser);
 
63
 
 
64
SCM ly_parse_file (SCM);
 
65
SCM ly_parse_string (SCM);
 
66
// SCM ly_parser_add_book_and_score (SCM, SCM);
 
67
SCM ly_parser_print_book (SCM, SCM);
 
68
SCM ly_parser_print_score (SCM, SCM);
 
69
SCM ly_parser_bookify (SCM, SCM);
 
70
SCM ly_parser_scorify (SCM, SCM);
 
71
 
 
72
Output_def *get_layout (Lily_parser *parser);
 
73
Output_def *get_midi (Lily_parser *parser);
 
74
Output_def *get_paper (Lily_parser *parser);
 
75
SCM get_header (Lily_parser *parser);
 
76
 
 
77
#endif /* LILY_PARSER_HH */