~ubuntu-branches/ubuntu/hardy/pxp/hardy

« back to all changes in this revision

Viewing changes to src/pxp-lex-generic/pxp_lex_within_tag.src

  • Committer: Bazaar Package Importer
  • Author(s): Stefano Zacchiroli
  • Date: 2005-03-29 11:06:39 UTC
  • mfrom: (2.1.2 hoary)
  • Revision ID: james.westby@ubuntu.com-20050329110639-5p39hz1d4aq3r2ec
Tags: 1.1.95-6
* Rebuilt against ocaml 3.08.3
* No longer built with wlex support (since wlex is no longer supported
  upstream and corresponding package has been removed from the debian
  archive)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
(* $Id: pxp_lex_within_tag.src,v 1.7 2002/03/13 22:45:45 gerd Exp $
2
 
 * ----------------------------------------------------------------------
3
 
 *
4
 
 *)
5
 
 
6
 
 
7
 
{
8
 
  open Pxp_types
9
 
  open Pxp_lexer_types
10
 
 
11
 
#insert open_pxp_lex_aux_*.src
12
 
}
13
 
 
14
 
#insert pxp_lex_defs_*.def
15
 
 
16
 
 
17
 
rule scan_within_tag = parse
18
 
    '\013' '\010'
19
 
      { tok_IgnoreLineEnd__Within_tag }
20
 
  | '\013'
21
 
      { tok_IgnoreLineEnd__Within_tag }
22
 
  | '\010'
23
 
      { tok_IgnoreLineEnd__Within_tag }
24
 
  | [' ' '\t']+
25
 
      { tok_Ignore__Within_tag }
26
 
  | name
27
 
      { Name (Lexing.lexeme lexbuf ), Within_tag }
28
 
  | '='
29
 
      { tok_Eq__Within_tag }
30
 
  | '"' character_except_quot* '"'
31
 
      { let l = Lexing.lexeme_end lexbuf - Lexing.lexeme_start lexbuf in
32
 
        let v = Pxp_lexing.sub_lexeme lexbuf 1 (l-2) in
33
 
        Attval v, Within_tag }
34
 
  | '"'
35
 
      { raise (WF_error ("Cannot find the second quotation mark"))
36
 
      }
37
 
  | "'" character_except_apos* "'"
38
 
      { let l = Lexing.lexeme_end lexbuf - Lexing.lexeme_start lexbuf in
39
 
        let v = Pxp_lexing.sub_lexeme lexbuf 1 (l-2) in
40
 
        Attval v, Within_tag }
41
 
  | "'"
42
 
      { raise (WF_error ("Cannot find the second quotation mark"))
43
 
      }
44
 
  | '>'
45
 
      { tok_Rangle__Content }
46
 
  | "/>"
47
 
      { tok_Rangle_empty__Content }
48
 
  | eof
49
 
      { tok_Eof__Within_tag }
50
 
  | character
51
 
      { raise (WF_error ("Illegal inside tags")) }
52
 
  | _
53
 
      { raise Netconversion.Malformed_code }
54
 
 
55
 
 
56
 
(* ======================================================================
57
 
 * History:
58
 
 * 
59
 
 * $Log: pxp_lex_within_tag.src,v $
60
 
 * Revision 1.7  2002/03/13 22:45:45  gerd
61
 
 *      Improved Pxp_lexing.
62
 
 *
63
 
 * Revision 1.6  2001/06/14 14:25:56  gerd
64
 
 *      Removed insertion of pxp_lex_aux.src
65
 
 *
66
 
 * Revision 1.5  2000/10/01 19:51:33  gerd
67
 
 *      Optimizations.
68
 
 *
69
 
 * Revision 1.4  2000/09/21 21:33:14  gerd
70
 
 *      Bugfix: Line counting within tags
71
 
 *
72
 
 * Revision 1.3  2000/08/14 22:18:34  gerd
73
 
 *      Bad_character_stream -> Netconversion.Malformed_code
74
 
 *
75
 
 * Revision 1.2  2000/05/29 23:53:12  gerd
76
 
 *      Updated because Markup_* modules have been renamed to Pxp_*.
77
 
 *
78
 
 * Revision 1.1  2000/05/20 20:33:25  gerd
79
 
 *      Initial revision.
80
 
 *
81
 
 * 
82
 
 *)