Exemplo n.º 1
0
 protected override void InitDetails(CompilerContext context, CompoundTerminalBase.CompoundTokenDetails details)
 {
     base.InitDetails(context, details);
     if (context.ScannerState.Value != 0)
     {
         //we are continuing partial string on the next line
         details.Flags        = context.ScannerState.TerminalFlags;
         details.SubTypeIndex = context.ScannerState.TokenSubType;
         var stringInfo = _subtypes[context.ScannerState.TokenSubType];
         details.StartSymbol = stringInfo.Start;
         details.EndSymbol   = stringInfo.End;
     }
 }
Exemplo n.º 2
0
 protected override void ReadSuffix(ISourceStream source, CompoundTerminalBase.CompoundTokenDetails details)
 {
     base.ReadSuffix(source, details);
     //"char" type can be identified by suffix (like VB where c suffix identifies char)
     // in this case we have details.TypeCodes[0] == char  and we need to set the IsChar flag
     if (details.TypeCodes != null && details.TypeCodes[0] == TypeCode.Char)
     {
         details.Flags |= (int)StringFlags.IsChar;
     }
     else
     //we may have IsChar flag set (from startEndSymbol, like in c# single quote identifies char)
     // in this case set type code
     if (details.IsSet((short)StringFlags.IsChar))
     {
         details.TypeCodes = new TypeCode[] { TypeCode.Char }
     }
     ;
 }