362
364
{'DigitMapDescriptorToken', Line, DMD}
364
366
{token, Token, Rest6, Line4};
365
_ when TokenTag == 'DigitMapToken' ->
367
_ when TokenTag =:= 'DigitMapToken' ->
366
368
%% 'DigitMapToken'
367
369
{token, {'DigitMapToken', Line, SafeChars}, All, Line};
369
371
{token, {'SafeChars', Line, SafeChars}, All, Line}
371
[?EqualToken | Rest2] when TokenTag == 'DigitMapToken' ->
373
[?EqualToken | Rest2] when TokenTag =:= 'DigitMapToken' ->
372
374
{Rest3, Line3} = skip_sep_chars(Rest2, Line2),
373
375
{Rest4, DigitMapName} = collect_safe_chars(Rest3, []),
374
376
{Rest6, Line6, DMD} =
376
DigitMapName == [] ->
378
DigitMapName =:= [] ->
377
379
{Rest3, Line3, #'DigitMapDescriptor'{}};
379
381
{Rest5, Line5} = skip_sep_chars(Rest4, Line3),
486
488
DMV#'DigitMapValue'{digitMapBody = All}
491
%% ============================================================================
492
%% <prev-parser-stuff>
494
%% This stuff was originally in the parser(s), but was,
495
%% for performance reasons, moved to the scanner(s). This
496
%% scanner does not make it faster, but the flex scanner
497
%% does, which is why the move was made.
500
property_groups(OctetString) ->
503
property_name(OctetString, Group, Groups).
505
property_name([Char | Rest] = All, Group, Groups) ->
507
?white_space(Char) ->
508
property_name(Rest, Group, Groups);
509
?end_of_line(Char) ->
510
property_name(Rest, Group, Groups);
513
do_property_name(All, Name, Group, Groups)
515
property_name([] = All, Group, Groups) ->
517
do_property_name(All, Name, Group, Groups).
519
do_property_name([Char | Rest], Name, Group, Groups)
520
when (Char =:= $=) andalso (Name =/= []) ->
521
%% Now we have a complete name
523
(Name =:= "v") andalso (Group =/= []) ->
524
%% v= is a property group delimiter,
525
%% lets create yet another property group.
526
Groups2 = [lists:reverse(Group) | Groups],
528
property_value(Rest, Name, Group2, Groups2);
530
%% Use current property group
531
property_value(Rest, Name, Group, Groups)
533
do_property_name([Char | Rest], Name, Group, Groups) ->
534
case ?classify_char4(Char) of
536
do_property_name(Rest, [Char | Name], Group, Groups);
538
do_property_name(Rest, [Char | Name], Group, Groups);
540
throw({error, {bad_prop_name, lists:reverse(Name), Char}})
542
do_property_name([], [], [], Groups) ->
543
lists:reverse(Groups);
544
do_property_name([], [], Group, Groups) ->
545
Group2 = lists:reverse(Group),
546
lists:reverse([Group2 | Groups]);
547
do_property_name([], Name, Group, Groups) when Name =/= [] ->
548
%% Assume end of line
550
PP = make_property_parm(Name, Value),
551
Group2 = lists:reverse([PP | Group]),
552
lists:reverse([Group2 | Groups]).
554
-ifdef(megaco_scanner_inline).
555
-compile({inline,[{property_value,4}]}).
557
property_value(Chars, Name, Group, Groups) ->
559
do_property_value(Chars, Name, Value, Group, Groups).
561
do_property_value([Char | Rest], Name, Value, Group, Groups) ->
563
?end_of_line(Char) ->
564
%% Now we have a complete "name=value" pair
565
PP = make_property_parm(Name, Value),
566
property_name(Rest, [PP | Group], Groups);
568
do_property_value(Rest, Name, [Char | Value], Group, Groups)
570
do_property_value([], Name, Value, Group, Groups) ->
571
%% Assume end of line
572
PP = make_property_parm(Name, Value),
573
Group2 = lists:reverse([PP | Group]),
574
lists:reverse([Group2 | Groups]).
576
-ifdef(megaco_scanner_inline).
577
-compile({inline,[{make_property_parm,2}]}).
579
make_property_parm(Name, Value) ->
580
%% Record name, name field, value field, extraInfo field
583
[lists:reverse(Value)],
587
%% </prev-parser-stuff>
588
%% ===========================================================================
489
590
select_token([$o, $- | LowerText], Version) ->
490
591
select_token(LowerText, Version);
491
592
select_token([$w, $- | LowerText], Version) ->