private void untypedIdentifier(IdentifierNode identifierNode)
        {
            if (current is Character && current.Text == ":")
            {
                SyntaxNode entityNode =
                    new EntityNode(identifierNode.Text);
                identifierNode.ReplaceWith(entityNode);

                read();
            }
            else if ((current is Character && current.Text == "?") || current is Arrow || current is NewLine)
            {
                PropertyNode propertyNode = new PropertyNode(identifierNode.Text);
                identifierNode.ReplaceWith(propertyNode);

                modRequired(propertyNode);
                modForeignKey(propertyNode);
            }
            else
                throw new SyntaxException();
        }
        private void typedIdentifier(SyntaxNode parentNode)
        {
            if (current is Identifier)
            {
                var propertyNode = new PropertyNode(current.Text).AddTo(parentNode) as PropertyNode;
                read(); // identifier
                modRequired(propertyNode);
                modForeignKey(propertyNode);
            }
            else if (current is Character && current.Text == "[")
            {
                read(); // [
                if (!(current is Identifier))
                    throw new SyntaxException();

                PropertyNode propertyName =
                    new PropertyNode(current.Text, true).AddTo(parentNode) as PropertyNode;

                read(); // identifier
                if (!(current is Character) || current.Text != "]")
                    throw new SyntaxException();

                read(); // ]
                modRequired(propertyName);
                modForeignKey(propertyName);
            }
            else
                throw new SyntaxException();
        }
 private void modRequired(PropertyNode parentNode)
 {
     if (current is Character && current.Text == "?")
     {
         parentNode.IsRequired = false;
         read(); // ?
     }
 }
        private void statement(SyntaxNode parentNode)
        {
            if (current is Character && current.Text == "@")
            {
                read(); // @
                command(parentNode);
            }
            else if (current is Identifier)
            {
                IdentifierNode identifierNode =
                    new IdentifierNode(current.Text).AddTo(parentNode) as IdentifierNode; // can be an entity or a property

                read(); // identifier
                untypedIdentifier(identifierNode);
            }
            else if (current is Character && "$#&!".Contains(current.Text))
            {
                new PropTypeNode(current.Text.ToPropertyType()).AddTo(parentNode);
                propType();
                typedIdentifier(parentNode);
            }
            else if (current is Character && current.Text == "[")
            {
                read(); // [

                if (!(current is Identifier))
                    throw new SyntaxException();

                PropertyNode propertyName =
                    new PropertyNode(current.Text, true).AddTo(parentNode) as PropertyNode;

                read(); // identifier
                if (!(current is Character) || current.Text != "]")
                    throw new SyntaxException();

                read(); // ]
                modRequired(propertyName);
                modForeignKey(propertyName);
            }
            else
                throw new SyntaxException();
        }
 private void modForeignKey(PropertyNode parentNode)
 {
     if (current is Arrow)
     {
         parentNode.IsNavigationProperty = true;
         read(); // arrow
     }
 }