455
455
if (_tokenizer.Accept(SymType.Dot))
457
457
//This is a group item, rather than an elementary item
459
data.Type = DataType.String;
459
460
//=============================================================================
460
461
//ws.DataDescriptions.Add(data);
461
462
if (data.Name!=null){
788
784
source = literal as Source;
792
source = ParseLiteral() as Source;
788
source = ParseFigurativeConstant() as Source;
795
source = ParseIdentifier() as Source;
791
source = ParseLiteral() as Source;
796
792
if (source == null)
798
source.LineNumber = _tokenizer.LineNumber;
800
// if (_tokenizer.Accept(SymType.Delimited))
802
// Console.WriteLine("*** PARSING DELIMITED ***");
803
// Identifier iden = source as Identifier;
804
// _tokenizer.Accept(SymType.By);//optional BY
805
// iden.Delimiter = ParseSource();
794
source = ParseIdentifier() as Source;
797
source.LineNumber = _tokenizer.LineNumber;
799
// if (_tokenizer.Accept(SymType.Delimited))
801
// Console.WriteLine("*** PARSING DELIMITED ***");
802
// Identifier iden = source as Identifier;
803
// _tokenizer.Accept(SymType.By);//optional BY
804
// iden.Delimiter = ParseSource();
809
if (source.GetType() == typeof(Identifier))
811
Identifier id = source as Identifier;
809
// if (source.GetType() == typeof(Identifier))
811
// Identifier id = source as Identifier;
813
813
if (goBackOnDot==true && source!=null && _tokenizer.CurrentSymbol!=null && _tokenizer.CurrentSymbol.Type == SymType.Dot)
815
815
_tokenizer.RestorePosition();
823
823
_ast.VariableReferences.Add(source);
828
private FigurativeConstant ParseFigurativeConstant()
830
FigurativeConstant fc = new FigurativeConstant();
831
if (_tokenizer.Accept(SymType.Spaces))
833
fc.Type = FigurativeConstantType.Spaces;
828
840
private ProcedureDivision ParseProcedureDivision()
1085
1097
WriteStatement writeStatement = new WriteStatement();
1086
1098
//TODO: More complex versions of WRITE
1087
1099
writeStatement.RecordName = ParseIdentifier();
1100
_ast.VariableReferences.Add(writeStatement.RecordName);
1088
1101
if (_tokenizer.Accept(SymType.From))
1090
1103
writeStatement.From = ParseIdentifier();
1104
_ast.VariableReferences.Add(writeStatement.From);
1092
1106
_tokenizer.Accept(SymType.EndWrite);
1093
1107
return writeStatement;